<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>页面装修</title>
    <link href="__PUBLIC__/static/css/tp-base.css" rel="stylesheet" />
    <link href="__PUBLIC__/static/css/tp-pc-decorate.css" rel="stylesheet" />
    <link href="__PUBLIC__/static/css/tp-pc-package.css" rel="stylesheet" />
    <script src="__PUBLIC__/static/js/jquery-1.9.1-min.js" type="text/javascript"></script>
    <script src="__PUBLIC__/static/js/swipeSlide.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="__PUBLIC__/static/js/layer/layer.js"></script><!-- 弹窗js 参考文档 http://layer.layui.com/-->
    <script src="__PUBLIC__/js/global.js"></script>
    <script src="__PUBLIC__/static/js/tp-drag-join-module.js"></script>
</head>
<body class="not-select">
<div class="tp-decorate-wrap">
    <ul class="tpd-head">
        <li>
            <label>模板名称：</label>
            <input id="block_name" class="tpd-module-name" value="{$template_name}" type="text" placeholder="未命名" />
        </li>
        <!--li>
            <label>店铺分享描述：</label>
            <input class="tpd-module-des" type="text" placeholder="请输入店铺分享描述" />
        </li-->
    </ul>
    <div class="tpd-main">
        <h3 class="tpd-scetion-title">模板样式预览</h3>
        <div class="tpd-scetion-cont clearfix">
            <div class="tpd-mobile-show">
                <div class="tpd-mobile-scroll scrollbar">
                    <div class="tpd-mobile-views" id="tpd-mobile-views" data-diy="1">

                    <if condition="$html">
                        {$html}
                    <else />
                        <div class="tpdm-head-wrap" data-name="搜索框">
                            <div class="tpdm-head-js">

                            </div>
                            <i class="tpd-editing-close"></i>
                            <script>
                                $('.tpdm-head-wrap').click(function () {
                                    $(this).toggleClass('tpdm-head-edit');
                                });
                                $('.tpdm-head-wrap>.tpd-editing-close').click(function () {
                                    $(this).parents('.tpdm-head-wrap').find('.tpdm-head-js').removeClass('tpdm-head-scale').html('');
                                    block.is_search=0;
                                    delete block.search_style;
                                    delete block[block.search_id];
                                    delete block.search_id;
                                })

                            </script>
                        </div>
                        <div class="tpdm-footer-wrap" data-name="底部导航-隐藏">

                        </div>
                    </if>

                    </div>
                </div>
                <div class="tpdm-footer-false">
                    <div class="tpdm-footf-js">
                    </div>
                    <i class="tpd-editing-close"></i>
                    <script>
                        $('.tpdm-footer-false').click(function () {
                            $(this).toggleClass('tpdm-footf-edit');
                        });
                        $('.tpdm-footer-false>.tpd-editing-close').click(function () {
                            block.is_footer=0;
                            delete block.footer_type;
                            delete block[block.footer_id];
                            delete block.footer_id;
                            $(this).parents('.tpdm-footer-false').removeClass('tpdm-footerf-show').find('.tpdm-footf-js').html('');
                            $('.tpdm-footer-wrap').html('');
                        })
                    </script>
                </div>
            </div>
            <div class="tpd-eidt-tools">
                <div class="tpd-tools-title"><b>组件库</b>（拖拽想要添加的组件）</div>
                <div class="tpd-tools clearfix">
                    <div class="tpd-tool-wrap">
                        <h5><em>复用</em>（可多次使用的组件）</h5>
                        <ul class="tpd-tool-list clearfix">
                            <li data-eidtid="0">
                                <i class="tpd-ico ico-menus1"></i>
                                <label>自定义海报</label>
                            </li>
                            <li data-eidtid="1">
                                <i class="tpd-ico ico-menus2"></i>
                                <label>轮播广告</label>
                            </li>
                            <li data-eidtid="2">
                                <i class="tpd-ico ico-menus3"></i>
                                <label>快捷入口</label>
                            </li>
                            <li data-eidtid="3">
                                <i class="tpd-ico ico-menus4"></i>
                                <label>商品列表</label>
                            </li>
                            <li data-eidtid="4">
                                <i class="tpd-ico ico-menus5"></i>
                                <label>橱窗</label>
                            </li>
                            <li data-eidtid="5">
                                <i class="tpd-ico ico-menus6"></i>
                                <label>文本导航</label>
                            </li>
                            <li data-eidtid="6">
                                <i class="tpd-ico ico-menus7"></i>
                                <label>营销活动</label>
                            </li>
                            <li data-eidtid="7">
                                <i class="tpd-ico ico-menus8"></i>
                                <label>优惠券</label>
                            </li>
                            <li data-eidtid="12">
                                <i class="tpd-ico ico-menus4"></i>
                                <label>轮播多图</label>
                            </li>
                        </ul>
                    </div>
                    <div class="tpd-tool-wrap">
                        <h5><em>单选</em>（单页面仅可使用一次）</h5>
                        <ul class="tpd-tool-list clearfix">
                            <li data-eidtid="8">
                                <i class="tpd-ico ico-menus9"></i>
                                <label>搜索栏</label>
                            </li>
                            <!--li data-eidtid="9">
                                <i class="tpd-ico ico-menus10"></i>
                                <label>店铺头部</label>
                            </li-->
                            <li data-eidtid="10">
                                <i class="tpd-ico ico-menus11"></i>
                                <label>公告</label>
                            </li>
                            <li data-eidtid="11">
                                <i class="tpd-ico ico-menus12"></i>
                                <label>底部菜单</label>
                            </li>
                        </ul>
                    </div>
                </div>
                <div class="tpd-tools-title"><b>组件样式</b></div>
                <div class="tpd-diy-box">
                    <div class="tpd-diy-js tpd-poster">
                        <div class="tpd-diy-title">自定义海报设置</div>
                        <dl class="tpd-cstyle-dl clearfix">
                            <dt>样式选择 : </dt>
                            <dd><label data-radio="1"><input value="0" id="height0" type="radio" name="poster1" checked />固定高度</label></dd>
                            <dd><label data-radio="2"><input value="1" id="height1" type="radio" name="poster1" />自适应高度</label></dd>
                        </dl>
                        <label class="tpd-diy-bb tpd-cdiy-font28">下间距 :<input type="text" value="10" />px</label>
                        <div class="tpd-poster-stlye tpd-cdiy-list">
                            <div class="postlye-ac clearfix">
                                <div class="tpd-wstyle-uploadimg" id="poster" onclick="getpath(this);">
                                    <span></span>
                                    <label>建议宽度750px，高度400px<br />
                                        如尺寸不达标，图片将自适应显示</label>
                                </div>
                                <div class="tpd-wstyle-addlink">
                                    <span>链接设置</span>
                                    <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                    <label>请先上传图片</label>
                                </div>
                            </div>
                            <div class="clearfix">
                                <div class="tpd-wstyle-uploadimg" onclick="getpath(this);">
                                    <span></span>
                                    <label>建议宽度750px，高度自适应<br />
                                        高度超过750px，将裁剪超出部分</label>
                                </div>
                                <div class="tpd-wstyle-addlink">
                                    <span>链接设置</span>
                                    <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                    <label>请先上传图片</label>
                                </div>
                            </div>
                        </div>
                        <script>
                            $('.tpd-poster .tpd-cstyle-dl').find('label').click(function () {
                                var i=$(this).attr('data-radio');
                                $('.tpd-edits-hidden.tpd-editing').find('.tpdm-postyle').removeClass('tpdm-postyle1').removeClass('tpdm-postyle2').addClass('tpdm-postyle'+i);
                                $('.tpd-poster-stlye>div').removeClass('postlye-ac').eq(i-1).addClass('postlye-ac');
                            });
                        </script>
                    </div>
                    <div class="tpd-diy-js tpd-banner">
                        <div class="tpd-diy-title">轮播图广告设置</div>
                        <div class="tpd-banner-style">
                            <div class="tpd-cstyle-select tpd-cdiy-font28">
                                <label>轮播间隔 :</label>
                                <div class="tpd-select-wrap">
                                    <span id="banner-time-js">3s</span>
                                    <ul class="tpd-select-list">
                                        <li onclick="roll_time(this);" data-color="#ff2222">3s</li>
                                        <li onclick="roll_time(this);" data-color="#333">4s</li>
                                        <li onclick="roll_time(this);" data-color="#ffa509">5s</li>
                                        <li onclick="roll_time(this);" data-color="#50e200">6s</li>
                                    </ul>
                                </div>
                            </div>
                            <label class="tpd-diy-bb tpd-cdiy-font28">下间距 :<input type="text" value="10" />px</label>
                        </div>
                        <ul class="tpd-cdiy-list tpd-blist-js" id="roll">
                            <li>
                                <div class="tpd-wstyle-uploadimg">
                                    <span></span>
                                    <label>建议宽度372px，高度216px<br />
                                        如尺寸不达标，图片将自适应显示</label>
                                </div>
                                <div class="tpd-wstyle-addlink">
                                    <span>链接设置</span>
                                    <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                    <label>请先上传图片</label>
                                </div>
                                <div class="tpd-cdiy-identity"></div>
                                <a class="tpd-del-nav" href="javascript:;"></a>
                            </li>
                            <li>
                                <div class="tpd-wstyle-uploadimg">
                                    <span></span>
                                    <label>建议宽度372px，高度216px<br />
                                        如尺寸不达标，图片将自适应显示</label>
                                </div>
                                <div class="tpd-wstyle-addlink">
                                    <span>链接设置</span>
                                    <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                    <label>请先上传图片</label>
                                </div>
                                <div class="tpd-cdiy-identity"></div>
                                <a class="tpd-del-nav" href="javascript:;"></a>
                            </li>
                        </ul>
                        <div class="tpd-cadd-project"><i></i>新建目标</div>
                        <script>
                            function setBanner(){
                                var viewAc='.tpd-edits-hidden.tpd-editing';
                                function initBanner(fn){ //fn : 兼容删除 和 添加
                                    var t=parseInt($('#banner-time-js').text())*1000;
                                    var obj=$(viewAc).find('.tpdm-carousel');
                                    var id= $(viewAc).find('.tpdm-carousel').attr('id');
                                    obj.find('li').removeAttr('style');
                                    obj.find('li:first').remove();
                                    obj.find('li:last').remove();
                                    var li=obj.find('ul').html();
                                    var html='<ul class="tpd-banner-list">'+li+'</ul><div class="page-num"></div>';
                                    obj.html(html);
                                    fn&&fn();
                                    initSlide($(viewAc),id,t);
                                }
                                /*【轮播广告】时间下拉列表*/
                                $('.tpd-banner-style').find('.tpd-select-wrap').click(function (e) {
                                    $(this).toggleClass('tpd-select-ac');
                                    var target=$(e.target);
                                    if(target.is($(this).find('li'))){
                                        $(this).find('span').html(target.text());
                                        initBanner();
                                    }
                                });
                                $('.tpd-blist-js').on('click','.tpd-del-nav',function () {    //删除banner图
                                    if($('.tpd-blist-js>li').length<=2) return;
                                    var i=$(this).parents('li').index();
                                    initBanner(removeBanner(i));
                                    function removeBanner(i){
                                        $(viewAc).find('.tpd-banner-list>li').eq(i+1).remove();
                                    }
                                    $(this).parents('li').remove();
                                    block[divid].nav.splice(i,1);    //删除时同时删除block数组内对应内容
                                });
                                $('.tpd-banner .tpd-cadd-project').click(function () {  //添加banner图
                                    var li=$('.tpd-blist-js>li');
                                    if(li.length>=10) return;
                                    var html=li.last().clone();
                                    $('.tpd-blist-js').append(html);

                                    var b={};
                                    for(var k in block[divid].nav[block[divid].nav.length-1]){
                                        b[k]=block[divid].nav[block[divid].nav.length-1][k]

                                    }
                                    block[divid].nav.push(b);

                                    initBanner(addBanner);
                                    function addBanner(){
                                        var html1=$(viewAc).find('.tpd-banner-list>li').last().clone();
                                        $(viewAc).find('.tpd-banner-list').append(html1);
                                    }
                                });
                            }
                            setBanner();
                        </script>
                    </div>
                    <div class="tpd-diy-js tpd-navs">
                        <div class="tpd-diy-title">快捷入口设置</div>
                        <div class="tpd-navs-style">
                            <div class="tpd-navs-check">样式选择 : <label id="shape_type"><input value="0" type="radio" name="tpd-navs" checked />正方形</label><label><input value="1" type="radio" name="tpd-navs" />圆形</label></div>
                            <label class="tpd-diy-bb tpd-cdiy-font28">下间距 :<input type="text" value="10" />px</label>
                        </div>
                        <ul class="tpd-cdiy-list" id="tpd-navs-list">
                            <li>
                                <div class="tpd-nav-ico"><img src="__PUBLIC__/static/images/ico-nav1.jpg" alt="" /></div>
                                <div class="tpd-nav-cont">
                                    <div class="tpd-nav-name tpd-cdiy-font28">导航名称 : <input onblur="tit_name(this);" class="maxword-input-js" data-classid="5" data-maxlength="4" type="text" value="分类" /><span><i class="now-words">2</i>/4</span></div>
                                    <div class="tpd-cstyle-select tpd-cdiy-font28">
                                        <label>链接目标 :</label>
                                        <div class="tpd-select-wrap">
                                            <span>分类</span>
                                            <ul class="tpd-select-list">
                                                <li>分类</li>
                                                <li>关注</li>
                                                <li>收藏</li>
                                                <li>购物车</li>
                                                <li>个人中心</li>
                                                <li>创建链接</li>
                                            </ul>
                                        </div>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                    </div>
                                </div>
                                <div class="tpd-cdiy-identity"><img src="__PUBLIC__/static/images/ico-diy-drag.png" alt="" /></div>
                                <a class="tpd-del-nav" href="javascript:;"></a>
                            </li>
                            <li>
                                <div class="tpd-nav-ico"><img src="__PUBLIC__/static/images/ico-nav2.jpg" alt="" /></div>
                                <div class="tpd-nav-cont">
                                    <div class="tpd-nav-name tpd-cdiy-font28">导航名称 : <input onblur="tit_name(this);" class="maxword-input-js" data-classid="6" data-maxlength="4" type="text" value="关注" /><span><i class="now-words">2</i>/4</span></div>
                                    <div class="tpd-cstyle-select tpd-cdiy-font28">
                                        <label>链接目标 :</label>
                                        <div class="tpd-select-wrap">
                                            <span>分类</span>
                                            <ul class="tpd-select-list">
                                                <li>分类</li>
                                                <li>关注</li>
                                                <li>收藏</li>
                                                <li>购物车</li>
                                                <li>个人中心</li>
                                                <li>创建链接</li>
                                            </ul>
                                        </div>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                    </div>
                                </div>
                                <div class="tpd-cdiy-identity"><img src="__PUBLIC__/static/images/ico-diy-drag.png" alt="" /></div>
                                <a class="tpd-del-nav" href="javascript:;"></a>
                            </li>
                            <li>
                                <div class="tpd-nav-ico"><img src="__PUBLIC__/static/images/ico-nav3.jpg" alt="" /></div>
                                <div class="tpd-nav-cont">
                                    <div class="tpd-nav-name tpd-cdiy-font28">导航名称 : <input onblur="tit_name(this);" class="maxword-input-js" data-classid="7" data-maxlength="4" type="text" value="收藏" /><span><i class="now-words">2</i>/4</span></div>
                                    <div class="tpd-cstyle-select tpd-cdiy-font28">
                                        <label>链接目标 :</label>
                                        <div class="tpd-select-wrap">
                                            <span>分类</span>
                                            <ul class="tpd-select-list">
                                                <li>分类</li>
                                                <li>关注</li>
                                                <li>收藏</li>
                                                <li>购物车</li>
                                                <li>个人中心</li>
                                                <li>创建链接</li>
                                            </ul>
                                        </div>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                    </div>
                                </div>
                                <div class="tpd-cdiy-identity"><img src="__PUBLIC__/static/images/ico-diy-drag.png" alt="" /></div>
                                <a class="tpd-del-nav" href="javascript:;"></a>
                            </li>
                            <li>
                                <div class="tpd-nav-ico"><img src="__PUBLIC__/static/images/ico-nav4.jpg" alt="" /></div>
                                <div class="tpd-nav-cont">
                                    <div class="tpd-nav-name tpd-cdiy-font28">导航名称 : <input onblur="tit_name(this);" class="maxword-input-js" data-classid="8" data-maxlength="4" type="text" value="购物车" /><span><i class="now-words">2</i>/4</span></div>
                                    <div class="tpd-cstyle-select tpd-cdiy-font28">
                                        <label>链接目标 :</label>
                                        <div class="tpd-select-wrap">
                                            <span>分类</span>
                                            <ul class="tpd-select-list">
                                                <li>分类</li>
                                                <li>关注</li>
                                                <li>收藏</li>
                                                <li>购物车</li>
                                                <li>个人中心</li>
                                                <li>创建链接</li>
                                            </ul>
                                        </div>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                    </div>
                                </div>
                                <div class="tpd-cdiy-identity"><img src="__PUBLIC__/static/images/ico-diy-drag.png" alt="" /></div>
                                <a class="tpd-del-nav" href="javascript:;"></a>
                            </li>
                            <li>
                                <div class="tpd-nav-ico"><img src="__PUBLIC__/static/images/ico-nav5.jpg" alt="" /></div>
                                <div class="tpd-nav-cont">
                                    <div class="tpd-nav-name tpd-cdiy-font28">导航名称 : <input onblur="tit_name(this);" class="maxword-input-js" data-classid="9" data-maxlength="4" type="text" value="个人中心" /><span><i class="now-words">2</i>/4</span></div>
                                    <div class="tpd-cstyle-select tpd-cdiy-font28">
                                        <label>链接目标 :</label>
                                        <div class="tpd-select-wrap">
                                            <span>分类</span>
                                            <ul class="tpd-select-list">
                                                <li>分类</li>
                                                <li>关注</li>
                                                <li>收藏</li>
                                                <li>购物车</li>
                                                <li>个人中心</li>
                                                <li>创建链接</li>
                                            </ul>
                                        </div>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                    </div>
                                </div>
                                <div class="tpd-cdiy-identity"><img src="__PUBLIC__/static/images/ico-diy-drag.png" alt="" /></div>
                                <a class="tpd-del-nav" href="javascript:;"></a>
                            </li>
                        </ul>
                        <div class="tpd-cadd-project"><i></i>新建目标</div>
                        <script>
                            /*【快捷入口】样式选择*/
                            $('.tpd-navs-check>label').click(function () {
                                var obj={
                                    '正方形':0,
                                    '圆形':1
                                };
                                if(obj[$(this).text()]==0){
                                    $('.tpd-edits-hidden.tpd-editing').find('.tpdm-navstyle').removeClass('tpdm-navstyle-circle');
                                    block[divid]['shape_type']=0;
                                }else if(obj[$(this).text()]==1){
                                    $('.tpd-edits-hidden.tpd-editing').find('.tpdm-navstyle').addClass('tpdm-navstyle-circle');
                                    block[divid]['shape_type']=1;
                                }

                            });
                            /*【快捷入口】链接目标下拉列表*/
                            function selectNav(){
                                $('.tpd-cdiy-list>li').find('.tpd-select-wrap').unbind('click').click(function (e) {
                                    $(this).toggleClass('tpd-select-ac');
                                    var target=$(e.target);
                                    if(target.is($(this).find('li'))){
                                        $(this).find('span').html(target.text());
                                        $(this).parents('.tpd-cstyle-select').find('.tpd-addlink-target').removeClass('tpd-nav-addlink');
                                        if(target.is($(this).find('li:last'))){
                                            $(this).parents('.tpd-cstyle-select').find('.tpd-addlink-target').addClass('tpd-nav-addlink');
                                        }else{
                                            var j=target.parents('li').index();
                                            var viewUl=$('.tpd-edits-hidden.tpd-editing').find('.tpdm-navstyle');
                                            var url_item=target.attr('url-item');
                                            switch(url_item){
                                                case '0': //首页
                                                    block[divid].nav[j].url='/mobile/Index/index.html';
                                                    viewUl.find('a').eq(j).attr('href','/mobile/Index/index.html'); 
                                                    break;

                                                case '1': //分类
                                                    block[divid].nav[j].url='/mobile/Goods/categoryList.html';
                                                    viewUl.find('a').eq(j).attr('href','/mobile/Goods/categoryList.html'); 
                                                    break;

                                                case '2': //收藏
                                                    block[divid].nav[j].url='/Mobile/User/collect_list.html';
                                                    viewUl.find('a').eq(j).attr('href','/Mobile/User/collect_list.html'); 
                                                    break;

                                                case '3': //购物车
                                                    block[divid].nav[j].url='/mobile/Cart/index.html';
                                                    viewUl.find('a').eq(j).attr('href','/mobile/Cart/index.html'); 
                                                    break;

                                                case '4': //个人中心
                                                    block[divid].nav[j].url='/mobile/User/index.html';
                                                    viewUl.find('a').eq(j).attr('href','/mobile/User/index.html'); 
                                                    break;
                                            }
                                        }
                                    }
                                });
                            }
                            selectNav();

                            function navOperate(){
                                /*【快捷入口】删除列表*/
                                var navsUl=$('#tpd-navs-list');
                                var viewAc='.tpd-edits-hidden.tpd-editing';
                                var length;
                                var viewUl;
                                navsUl.on('click','.tpd-del-nav',function () {
                                    length = $('#tpd-navs-list>li').length;
                                    if (length < 4) return;
                                    var li=$(this).parents('li');
                                    var j=li.index();
                                    viewUl=$(viewAc).find('.tpdm-navstyle');

                                    viewUl.removeClass('tpdm-navstyle4 tpdm-navstyle5').addClass('tpdm-navstyle' +(length - 1));
                                    viewUl.find('a').eq(j).remove();
                                    li.remove();

                                    block[divid].nav.splice(j,1);    //删除时同时删除block数组内对应内容
                                });
                                /*【快捷入口】添加列表*/
                                $('.tpd-navs .tpd-cadd-project').click(function () {
                                    var aLi=$('#tpd-navs-list>li');
                                    length = aLi.length;
                                    if(length>4) return;
                                    navsUl.append(aLi.eq(0).clone());
                                    viewUl=$(viewAc).find('.tpdm-navstyle');
                                    viewUl.removeClass('tpdm-navstyle4 tpdm-navstyle5').addClass('tpdm-navstyle' +(length+1));
                                    viewUl.append(viewUl.find('a').eq(0).clone());

                                    var b={};
                                    for(var k in block[divid].nav[0]){
                                        b[k]=block[divid].nav[0][k];
                                    }
                                    block[divid].nav.push(b);   //添加时同时往block数组添加内容


                                    selectNav();//从新初始化下拉列表
                                });
                            }
                            navOperate();
                        </script>
                    </div>
                    <div class="tpd-diy-js tpd-goods">
                        <div class="tpd-diy-title">商品列表设置</div>
                        <div class="tpd-diy-subtitle">列表排版样式</div>
                        <div class="tpd-goods-style">
                            <dl class="tpd-cstyle-dl clearfix" id="goods-style">
                                <dt>显示布局 : </dt>
                                <dd><label data-listid="1"><input value="0" type="radio" name="goods-style1" checked /><i class="tpd-cstyle-ico2"></i>橱窗式</label></dd>
                                <dd><label data-listid="2"><input value="1" type="radio" name="goods-style1" /><i class="tpd-cstyle-ico1"></i>列表式</label></dd>
                                <dd><label data-listid="3"><input value="2" type="radio" name="goods-style1" /><i class="tpd-cstyle-ico3"></i>海报式</label></dd>
                            </dl>
                            <dl class="tpd-cstyle-dl clearfix" id="goods-num">
                                <dt>商品数量 : </dt>
                                <dd><label><input value="4" type="radio" name="goods-style2" checked />4个</label></dd>
                                <dd><label><input value="6" type="radio" name="goods-style2" />6个</label></dd>
                                <dd><label><input value="8" type="radio" name="goods-style2" />8个</label></dd>
                                <dd><label><input value="10" type="radio" name="goods-style2" />10个</label></dd>
                            </dl>
                            <label class="tpd-diy-bb tpd-cdiy-font28">下间距 :<input type="text" value="10" />px</label>
                        </div>
                        <div class="tpd-diy-subtitle">列表详情设置</div>
                        <div class="tpd-goods-style">
                            <dl class="tpd-cstyle-dl clearfix" id="goods-name">
                                <dt>列表名称 : </dt>
                                <dd><label data-showtitle="0"><input value="1" type="radio" name="goods-style3" checked />显示</label></dd>
                                <dd><label data-showtitle="1"><input value="0" type="radio" name="goods-style3" />隐藏</label></dd>
                            </dl>
                            <div class="tpd-cstyle-select tpd-cdiy-font28">
                                <label>商品排序 :</label>
                                <div class="tpd-select-wrap">
                                    <span>销量从高到低</span>
                                    <ul class="tpd-select-list" id="goods_order">
                                        <li>销量从高到低</li>
                                        <li>销量从低到高</li>
                                        <li>价格从高到低</li>
                                        <li>价格从低到高</li>
                                        <li>更新时间由近到远</li>
                                        <li>更新时间由远到近</li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                        <div class="js-goodstitle-list">
                            <ul class="tpd-cdiy-list" id="tab_list">
                                <li>
                                    <div class="f-l">
                                        <div class="tpd-goods-name tpd-cdiy-font28">列表名称 : <input onblur="tab_title(this);" class="maxword-input-js" data-classid="10" data-maxlength="8" type="text" value="列表名称1" /><span><i class="now-words">4</i>/8</span></div>
                                        <dl class="tpd-cstyle-dl clearfix">
                                            <dt>选取商品 : </dt>
                                            <dd><label><input class="screen" type="radio" name="goods-style4" />按条件选取</label></dd>
                                            <dd><label><input type="radio" class="hand1" name="goods-style4" />手动添加</label></dd>
                                        </dl>
                                    </div>
                                    <div class="tpd-cdiy-identity"><img src="__PUBLIC__/static/images/ico-diy-drag.png" alt="" /></div>
                                    <a class="tpd-del-nav" href="javascript:;"></a>
                                </li>
                                <li>
                                    <div class="f-l">
                                        <div class="tpd-goods-name tpd-cdiy-font28">列表名称 : <input onblur="tab_title(this);" class="maxword-input-js" data-classid="11" data-maxlength="8" type="text" value="列表名称2" /><span><i class="now-words">4</i>/8</span></div>
                                        <dl class="tpd-cstyle-dl clearfix">
                                            <dt>选取商品 : </dt>
                                            <dd><label><input class="screen" type="radio" name="goods-style5" />按条件选取</label></dd>
                                            <dd><label><input type="radio" class="hand1" name="goods-style5" />手动添加</label></dd>
                                        </dl>
                                    </div>
                                    <div class="tpd-cdiy-identity"><img src="__PUBLIC__/static/images/ico-diy-drag.png" alt="" /></div>
                                    <a class="tpd-del-nav" href="javascript:;"></a>
                                </li>
                                <li>
                                    <div class="f-l">
                                        <div class="tpd-goods-name tpd-cdiy-font28">列表名称 : <input onblur="tab_title(this);" class="maxword-input-js" data-classid="11" data-maxlength="8" type="text" value="列表名称3" /><span><i class="now-words">4</i>/8</span></div>
                                        <dl class="tpd-cstyle-dl clearfix">
                                            <dt>选取商品 : </dt>
                                            <dd><label><input class="screen" type="radio" name="goods-style6" />按条件选取</label></dd>
                                            <dd><label><input type="radio" class="hand1" name="goods-style6" />手动添加</label></dd>
                                        </dl>
                                    </div>
                                    <div class="tpd-cdiy-identity"><img src="__PUBLIC__/static/images/ico-diy-drag.png" alt="" /></div>
                                    <a class="tpd-del-nav" href="javascript:;"></a>
                                </li>
                            </ul>
                            <div class="tpd-cadd-project"><i></i>新建目标</div>
                        </div>
                        <script>
                            function setGoods(){
                                /*【快捷入口】链接目标下拉列表*/
                                $('.tpd-goods-style').find('.tpd-select-wrap').click(function (e) {
                                    $(this).toggleClass('tpd-select-ac');
                                    var target=$(e.target);
                                    if(target.is($(this).find('li'))){
                                        $(this).find('span').html(target.text());
                                    }
                                });

                                var viewAc='.tpd-edits-hidden.tpd-editing';
                                $('#goods-style').find('label').click(function () { //切换商品列表样式
                                    $(viewAc).find('.tpdm-goods-list').removeClass('tpdm-goods-list1 tpdm-goods-list2 tpdm-goods-list3').addClass('tpdm-goods-list'+$(this).attr('data-listid'));
                                    block[divid].show_type=$(this).find('input').val();
                                });
                                $('#goods-num').find('label').click(function () { //切换商品数量
                                    var viewNum=parseInt($(this).text());
                                    block[divid].num=viewNum;
                                    for (var t = 0; t< block[divid].nav.length; t++) {
                                        block[divid].nav[t].sql_where.num=viewNum;
                                    };
                                    var num=$(viewAc).find('.tpdm-goods-list li').length;

                                    $.post("{:U('Admin/Block/goods_list_block')}",{'num':viewNum,'order':block[divid].order},function(res){
                                        $(viewAc).find('.tpdm-goods-list ul').html(res.result);
                                    },'JSON');

                                });
                                $('#goods-name').find('label').click(function () { //是否显示标题
                                    if($(this).attr('data-showtitle')==1){
                                        block[divid].name_show=$(this).find('input').val();
                                        $('.js-goodstitle-list').hide();
                                        $(viewAc).find('.tpdm-goods-nav').hide();
                                    }else{
                                        block[divid].name_show=$(this).find('input').val();
                                        $('.js-goodstitle-list').show();
                                        $(viewAc).find('.tpdm-goods-nav').show();
                                    }
                                });

                                //切换并保存商品排序
                                $('#goods_order').find('li').click(function(){
                                    block[divid].order=$(this).index();
                                    $.post("{:U('Admin/Block/goods_list_block')}",{'num':block[divid].num,'order':block[divid].order},function(res){
                                        $(viewAc).find('.tpdm-goods-list ul').html(res.result);
                                    },'JSON');
                                })

                                //商品列表选项卡删除添加
                                $('.js-goodstitle-list').on('click','.tpd-del-nav',function () {   //删除
                                    var j=$(this).parents('li').index();
                                    var l=$('.js-goodstitle-list li').length;
                                    if(l<2) return;
                                    $(viewAc).find('.tpdm-goods-nav').removeClass('tpdm-goods-nav1 tpdm-goods-nav2 tpdm-goods-nav3 tpdm-goods-nav4').addClass('tpdm-goods-nav'+(l-1)).find('li').eq($(this).parents('li').index()).remove();
                                    $(this).parents('li').remove();
                                    block[divid].nav.splice(j,1);
                                })
                                $('.js-goodstitle-list .tpd-cadd-project').click(function () {   //添加
                                    var li=$('.js-goodstitle-list li');
                                    var view=$(viewAc).find('.tpdm-goods-nav');
                                    if(li.length>3) return;
                                    $('.js-goodstitle-list .tpd-cdiy-list').append(li.last().clone());
                                    view.removeClass('tpdm-goods-nav1 tpdm-goods-nav2 tpdm-goods-nav3 tpdm-goods-nav4').addClass('tpdm-goods-nav'+(li.length+1));
                                    view.append(view.find('li').last().clone());

                                    var b={};
                                    for(var k in block[divid].nav[block[divid].nav.length-1]){
                                        b[k]=block[divid].nav[block[divid].nav.length-1][k]
                                    }
                                    block[divid].nav.push(b);
                                })


                            }
                            setGoods();
                        </script>
                    </div>
                    <div class="tpd-diy-js tpd-window">
                        <div class="tpd-diy-title">橱窗设置</div>
                        <div class="tpd-diy-subtitle">橱窗样式选择</div>
                        <div class="tpd-window-style">
                            <ul class="clearfix">
                                <li class="tpd-wstyle-line style-ac"><img src="__PUBLIC__/static/images/pic-wstyle1.png" alt="" /></li>
                                <li class="tpd-wstyle-line"><img src="__PUBLIC__/static/images/pic-wstyle2.png" alt="" /></li>
                                <li><img src="__PUBLIC__/static/images/pic-wstyle3.png" alt="" /></li>
                                <li><img src="__PUBLIC__/static/images/pic-wstyle4.png" alt="" /></li>
                                <li class="tpd-wstyle-line"><img src="__PUBLIC__/static/images/pic-wstyle5.png" alt="" /></li>
                                <li><img src="__PUBLIC__/static/images/pic-wstyle6.png" alt="" /></li>
                                <li><img src="__PUBLIC__/static/images/pic-wstyle7.png" alt="" /></li>
                                <li><img src="__PUBLIC__/static/images/pic-wstyle8.png" alt="" /></li>
                                <li><img src="__PUBLIC__/static/images/pic-wstyle9.png" alt="" /></li>
                            </ul>
                            <label class="tpd-diy-bb tpd-cdiy-font28">下间距 :<input type="text" value="10" />px</label>
                        </div>
                        <div class="tpd-wstyle-wrap">
                            <ul class="tpd-wstyle-list wstyle-ac tpd-cdiy-list">
                                <li li-item="1">
                                    <div class="tpd-wstyle-uploadimg">
                                        <span></span>
                                        <label>建议宽度750zpx，高度312px<br />
                                            如尺寸不达标，图片将自适应显示</label>
                                    </div>
                                    <div class="tpd-wstyle-addlink">
                                        <span>链接设置</span>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                        <label>请先上传图片</label>
                                    </div>
                                    <div class="tpd-cdiy-identity">①</div>
                                </li>
                            </ul>
                            <ul class="tpd-wstyle-list tpd-cdiy-list">
                                <li li-item="1">
                                    <div class="tpd-wstyle-uploadimg">
                                        <span></span>
                                        <label>建议宽度372px，高度216px<br />
                                            如尺寸不达标，图片将自适应显示</label>
                                    </div>
                                    <div class="tpd-wstyle-addlink">
                                        <span>链接设置</span>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                        <label>请先上传图片</label>
                                    </div>
                                    <div class="tpd-cdiy-identity">①</div>
                                </li>
                                <li li-item="2">
                                    <div class="tpd-wstyle-uploadimg">
                                        <span></span>
                                        <label>建议宽度372px，高度216px<br />
                                            如尺寸不达标，图片将自适应显示</label>
                                    </div>
                                    <div class="tpd-wstyle-addlink">
                                        <span>链接设置</span>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                        <label>请先上传图片</label>
                                    </div>
                                    <div class="tpd-cdiy-identity">②</div>
                                </li>
                            </ul>
                            <ul class="tpd-wstyle-list tpd-cdiy-list">
                                <li li-item="1">
                                    <div class="tpd-wstyle-uploadimg">
                                        <span></span>
                                        <label>建议宽度246px，高度210px<br />
                                            如尺寸不达标，图片将自适应显示</label>
                                    </div>
                                    <div class="tpd-wstyle-addlink">
                                        <span>链接设置</span>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                        <label>请先上传图片</label>
                                    </div>
                                    <div class="tpd-cdiy-identity">①</div>
                                </li>
                                <li li-item="2">
                                    <div class="tpd-wstyle-uploadimg">
                                        <span></span>
                                        <label>建议宽度246px，高度210px<br />
                                            如尺寸不达标，图片将自适应显示</label>
                                    </div>
                                    <div class="tpd-wstyle-addlink">
                                        <span>链接设置</span>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                        <label>请先上传图片</label>
                                    </div>
                                    <div class="tpd-cdiy-identity">②</div>
                                </li>
                                <li li-item="3">
                                    <div class="tpd-wstyle-uploadimg">
                                        <span></span>
                                        <label>建议宽度246px，高度210px<br />
                                            如尺寸不达标，图片将自适应显示</label>
                                    </div>
                                    <div class="tpd-wstyle-addlink">
                                        <span>链接设置</span>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                        <label>请先上传图片</label>
                                    </div>
                                    <div class="tpd-cdiy-identity">③</div>
                                </li>
                            </ul>
                            <ul class="tpd-wstyle-list tpd-cdiy-list">
                                <li li-item="1">
                                    <div class="tpd-wstyle-uploadimg">
                                        <span></span>
                                        <label>建议宽度372px，高度234px<br />
                                            如尺寸不达标，图片将自适应显示</label>
                                    </div>
                                    <div class="tpd-wstyle-addlink">
                                        <span>链接设置</span>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                        <label>请先上传图片</label>
                                    </div>
                                    <div class="tpd-cdiy-identity">①</div>
                                </li>
                                <li li-item="2">
                                    <div class="tpd-wstyle-uploadimg">
                                        <span></span>
                                        <label>建议宽度372px，高度114px<br />
                                            如尺寸不达标，图片将自适应显示</label>
                                    </div>
                                    <div class="tpd-wstyle-addlink">
                                        <span>链接设置</span>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                        <label>请先上传图片</label>
                                    </div>
                                    <div class="tpd-cdiy-identity">②</div>
                                </li>
                                <li li-item="3">
                                    <div class="tpd-wstyle-uploadimg">
                                        <span></span>
                                        <label>建议宽度372px，高度114px<br />
                                            如尺寸不达标，图片将自适应显示</label>
                                    </div>
                                    <div class="tpd-wstyle-addlink">
                                        <span>链接设置</span>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                        <label>请先上传图片</label>
                                    </div>
                                    <div class="tpd-cdiy-identity">③</div>
                                </li>
                            </ul>
                            <ul class="tpd-wstyle-list tpd-cdiy-list">
                                <li li-item="1">
                                    <div class="tpd-wstyle-uploadimg">
                                        <span></span>
                                        <label>建议宽度750px，高度180px<br />
                                            如尺寸不达标，图片将自适应显示</label>
                                    </div>
                                    <div class="tpd-wstyle-addlink">
                                        <span>链接设置</span>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                        <label>请先上传图片</label>
                                    </div>
                                    <div class="tpd-cdiy-identity">①</div>
                                </li>
                                <li li-item="2">
                                    <div class="tpd-wstyle-uploadimg">
                                        <span></span>
                                        <label>建议宽度372px，高度180px<br />
                                            如尺寸不达标，图片将自适应显示</label>
                                    </div>
                                    <div class="tpd-wstyle-addlink">
                                        <span>链接设置</span>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                        <label>请先上传图片</label>
                                    </div>
                                    <div class="tpd-cdiy-identity">②</div>
                                </li>
                                <li li-item="3">
                                    <div class="tpd-wstyle-uploadimg">
                                        <span></span>
                                        <label>建议宽度372px，高度180px<br />
                                            如尺寸不达标，图片将自适应显示</label>
                                    </div>
                                    <div class="tpd-wstyle-addlink">
                                        <span>链接设置</span>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                        <label>请先上传图片</label>
                                    </div>
                                    <div class="tpd-cdiy-identity">③</div>
                                </li>
                            </ul>
                            <ul class="tpd-wstyle-list tpd-cdiy-list">
                                <li li-item="1">
                                    <div class="tpd-wstyle-uploadimg">
                                        <span></span>
                                        <label>建议宽度183px，建议宽度183px<br />
                                            如尺寸不达标，图片将自适应显示</label>
                                    </div>
                                    <div class="tpd-wstyle-addlink">
                                        <span>链接设置</span>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                        <label>请先上传图片</label>
                                    </div>
                                    <div class="tpd-cdiy-identity">①</div>
                                </li>
                                <li li-item="2">
                                    <div class="tpd-wstyle-uploadimg">
                                        <span></span>
                                        <label>建议宽度183px，建议宽度183px<br />
                                            如尺寸不达标，图片将自适应显示</label>
                                    </div>
                                    <div class="tpd-wstyle-addlink">
                                        <span>链接设置</span>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                        <label>请先上传图片</label>
                                    </div>
                                    <div class="tpd-cdiy-identity">②</div>
                                </li>
                                <li li-item="3">
                                    <div class="tpd-wstyle-uploadimg">
                                        <span></span>
                                        <label>建议宽度183px，建议宽度183px<br />
                                            如尺寸不达标，图片将自适应显示</label>
                                    </div>
                                    <div class="tpd-wstyle-addlink">
                                        <span>链接设置</span>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                        <label>请先上传图片</label>
                                    </div>
                                    <div class="tpd-cdiy-identity">③</div>
                                </li>
                                <li li-item="4">
                                    <div class="tpd-wstyle-uploadimg">
                                        <span></span>
                                        <label>建议宽度183px，建议宽度183px<br />
                                            如尺寸不达标，图片将自适应显示</label>
                                    </div>
                                    <div class="tpd-wstyle-addlink">
                                        <span>链接设置</span>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                        <label>请先上传图片</label>
                                    </div>
                                    <div class="tpd-cdiy-identity">④</div>
                                </li>
                            </ul>
                            <ul class="tpd-wstyle-list tpd-cdiy-list">
                                <li li-item="1">
                                    <div class="tpd-wstyle-uploadimg">
                                        <span></span>
                                        <label>建议宽度372px，高度360px<br />
                                            如尺寸不达标，图片将自适应显示</label>
                                    </div>
                                    <div class="tpd-wstyle-addlink">
                                        <span>链接设置</span>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                        <label>请先上传图片</label>
                                    </div>
                                    <div class="tpd-cdiy-identity">①</div>
                                </li>
                                <li li-item="2">
                                    <div class="tpd-wstyle-uploadimg">
                                        <span></span>
                                        <label>建议宽度372px，高度204px<br />
                                            如尺寸不达标，图片将自适应显示</label>
                                    </div>
                                    <div class="tpd-wstyle-addlink">
                                        <span>链接设置</span>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                        <label>请先上传图片</label>
                                    </div>
                                    <div class="tpd-cdiy-identity">②</div>
                                </li>
                                <li li-item="3">
                                    <div class="tpd-wstyle-uploadimg">
                                        <span></span>
                                        <label>建议宽度183px，高度150px<br />
                                            如尺寸不达标，图片将自适应显示</label>
                                    </div>
                                    <div class="tpd-wstyle-addlink">
                                        <span>链接设置</span>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                        <label>请先上传图片</label>
                                    </div>
                                    <div class="tpd-cdiy-identity">③</div>
                                </li>
                                <li li-item="4">
                                    <div class="tpd-wstyle-uploadimg">
                                        <span></span>
                                        <label>建议宽度183px，高度150px<br />
                                            如尺寸不达标，图片将自适应显示</label>
                                    </div>
                                    <div class="tpd-wstyle-addlink">
                                        <span>链接设置</span>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                        <label>请先上传图片</label>
                                    </div>
                                    <div class="tpd-cdiy-identity">④</div>
                                </li>
                            </ul>
                            <ul class="tpd-wstyle-list tpd-cdiy-list">
                                <li li-item="1">
                                    <div class="tpd-wstyle-uploadimg">
                                        <span></span>
                                        <label>建议宽度372px，高度360px<br />
                                            如尺寸不达标，图片将自适应显示</label>
                                    </div>
                                    <div class="tpd-wstyle-addlink">
                                        <span>链接设置</span>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                        <label>请先上传图片</label>
                                    </div>
                                    <div class="tpd-cdiy-identity">①</div>
                                </li>
                                <li li-item="2">
                                    <div class="tpd-wstyle-uploadimg">
                                        <span></span>
                                        <label>建议宽度750px，高度180px<br />
                                            如尺寸不达标，图片将自适应显示</label>
                                    </div>
                                    <div class="tpd-wstyle-addlink">
                                        <span>链接设置</span>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                        <label>请先上传图片</label>
                                    </div>
                                    <div class="tpd-cdiy-identity">②</div>
                                </li>
                                <li li-item="3">
                                    <div class="tpd-wstyle-uploadimg">
                                        <span></span>
                                        <label>建议宽度372px，高度177px<br />
                                            如尺寸不达标，图片将自适应显示</label>
                                    </div>
                                    <div class="tpd-wstyle-addlink">
                                        <span>链接设置</span>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                        <label>请先上传图片</label>
                                    </div>
                                    <div class="tpd-cdiy-identity">③</div>
                                </li>
                                <li li-item="4">
                                    <div class="tpd-wstyle-uploadimg">
                                        <span></span>
                                        <label>建议宽度372px，高度177px<br />
                                            如尺寸不达标，图片将自适应显示</label>
                                    </div>
                                    <div class="tpd-wstyle-addlink">
                                        <span>链接设置</span>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                        <label>请先上传图片</label>
                                    </div>
                                    <div class="tpd-cdiy-identity">④</div>
                                </li>
                            </ul>
                            <ul class="tpd-wstyle-list tpd-cdiy-list">
                                <li li-item="1">
                                    <div class="tpd-wstyle-uploadimg">
                                        <span></span>
                                        <label>建议宽度372px，高度216px<br />
                                            如尺寸不达标，图片将自适应显示</label>
                                    </div>
                                    <div class="tpd-wstyle-addlink">
                                        <span>链接设置</span>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                        <label>请先上传图片</label>
                                    </div>
                                    <div class="tpd-cdiy-identity">①</div>
                                </li>
                                <li li-item="2">
                                    <div class="tpd-wstyle-uploadimg">
                                        <span></span>
                                        <label>建议宽度372px，高度216px<br />
                                            如尺寸不达标，图片将自适应显示</label>
                                    </div>
                                    <div class="tpd-wstyle-addlink">
                                        <span>链接设置</span>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                        <label>请先上传图片</label>
                                    </div>
                                    <div class="tpd-cdiy-identity">②</div>
                                </li>
                                <li li-item="3">
                                    <div class="tpd-wstyle-uploadimg">
                                        <span></span>
                                        <label>建议宽度375px，高度216px<br />
                                            如尺寸不达标，图片将自适应显示</label>
                                    </div>
                                    <div class="tpd-wstyle-addlink">
                                        <span>链接设置</span>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                        <label>请先上传图片</label>
                                    </div>
                                    <div class="tpd-cdiy-identity">③</div>
                                </li>
                                <li li-item="4">
                                    <div class="tpd-wstyle-uploadimg">
                                        <span></span>
                                        <label>建议宽度375px，高度216px<br />
                                            如尺寸不达标，图片将自适应显示</label>
                                    </div>
                                    <div class="tpd-wstyle-addlink">
                                        <span>链接设置</span>
                                        <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                        <label>请先上传图片</label>
                                    </div>
                                    <div class="tpd-cdiy-identity">④</div>
                                </li>
                            </ul>
                        </div>
                        <script>
                            $('.tpd-window-style li').click(function(){
                                $(this).addClass('style-ac').siblings().removeClass('style-ac');
                                $('.tpd-wstyle-list').eq($(this).index()).addClass('wstyle-ac').siblings().removeClass('wstyle-ac');
                                    $('.tpd-edits-hidden.tpd-editing').find('.js-code-wrap').html(diyHtml['tpd-window'][$(this).index()]);

                                //橱窗模式点击选择显示风格并存入block
                                window_type=$(this).index();
                                if(block[divid]['block_type']=='4'){
                                    block[divid]['window_style']=window_type;
/*                                    if(window_type==0){
                                        block[divid].pic=['',''];
                                        block[divid].url=['',''];
                                    }
                                    if(window_type==1){
                                        block[divid].pic=['','',''];
                                        block[divid].url=['','',''];
                                    }
                                    if(window_type>1 && window_type<5){
                                        block[divid].pic=['','','',''];
                                        block[divid].url=['','','',''];
                                    }
                                    if(window_type>4){
                                        block[divid].pic=['','','','',''];
                                        block[divid].url=['','','','',''];
                                    }*/
                                }
                            });
                        </script>
                    </div>
                    <div class="tpd-diy-js tpd-txtnav">
                        <div class="tpd-diy-title">文本导航设置</div>
                        <div class="tpd-txtnav-style">
                            <div class="tpd-cstyle-select tpd-cdiy-font28">
                                <label>字体颜色 :</label>
                                <div class="tpd-select-wrap">
                                    <span id="color_show">红色</span>
                                    <ul class="tpd-select-list" id="color_choice">
                                        <li data-color="#ff2222">红色</li>
                                        <li data-color="#333">黑色</li>
                                        <li data-color="#ffa509">橙色</li>
                                        <li data-color="#50e200">绿色</li>
                                    </ul>
                                </div>
                                <script>
                                    /*【文本导航】字体颜色下拉列表*/
                                    $('.tpd-txtnav-style').find('.tpd-select-wrap').click(function (e) {
                                        $(this).toggleClass('tpd-select-ac');
                                        var target=$(e.target);
                                        if(target.is($(this).find('li'))){
                                            $(this).find('span').html(target.text());
                                            block[divid]['color']=target.attr('data-color'); //保存文本导航字体颜色
                                            $('.tpd-edits-hidden.tpd-editing').find('.tpdm-txtnav-list').css('color',target.attr('data-color'));
                                        }

                                    })
                                </script>
                            </div>
                            <label class="tpd-diy-bb tpd-cdiy-font28">下间距 :<input type="text" value="10" />px</label>
                        </div>
                        <ul class="tpd-cdiy-list">
                            <li>
                                <div class="tpd-txtnav-set">
                                    <div class="tpd-txtnav-name tpd-cdiy-font28">公告标签 : <input id="txt_nav" onblur="txt_title(this);" class="maxword-input-js" data-classid="13" data-maxlength="10" type="text" value="查看更多" /><span><i class="now-words">4</i>/10</span></div>
                                    <div class="tpd-txtnav-addlink tpd-cdiy-font28">
                                        <label>链接设置 : </label>
                                        <div class="tpd-addlink-target" id="txt_url"><i></i>添加链接目标</div>
                                    </div>
                                </div>
                                <div class="tpd-cdiy-identity"></div>
                                <a class="tpd-del-nav" href="javascript:;"></a>
                            </li>
                        </ul>
                    </div>
                     <div class="tpd-diy-js tpd-newArrival">
                        <div class="tpd-diy-title">最新上线</div>
                        <div class="tpd-diy-subtitle">列表排版样式</div>
                        <div class="tpd-goods-style">
                            <dl class="tpd-cstyle-dl clearfix" id="goodIds-num">
                                <dt>商品数量 : </dt>
                                <dd><label><input value="3" type="radio" name="goods-style2" checked />3个</label></dd>
                                <dd><label><input value="6" type="radio" name="goods-style2" />6个</label></dd>
                                <dd><label><input value="9" type="radio" name="goods-style2" />9个</label></dd>
                                <dd><label><input value="12" type="radio" name="goods-style2" />12个</label></dd>
                            </dl>
                            <label class="tpd-diy-bb tpd-cdiy-font28">下间距 :<input type="text" value="10" />px</label>
                        </div>
                        <div class="tpd-diy-subtitle">列表详情设置</div>
                        <div class="tpd-goods-style">
                            <dl class="tpd-cstyle-dl clearfix" id="goods-name">
                                <dt>列表名称 : </dt>
                                <dd><label data-showtitle="0"><input value="1" type="radio" name="goods-style3" checked />显示</label></dd>
                                <dd><label data-showtitle="1"><input value="0" type="radio" name="goods-style3" />隐藏</label></dd>
                            </dl>
                            <div class="tpd-cstyle-select tpd-cdiy-font28">
                                <label>商品排序 :</label>
                                <div class="tpd-select-wrap">
                                    <span>销量从高到低</span>
                                    <ul class="tpd-select-list">
                                        <li>销量从高到低</li>
                                        <li>销量从低到高</li>
                                        <li>价格从高到低</li>
                                        <li>价格从低到高</li>
                                        <li>更新时间由近到远</li>
                                        <li>更新时间由远到近</li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                        <div class="js-goodstitle-list" style="margin-top: 20px;">
                            <ul class="tpd-cdiy-list" id="tab_list">
                                <li>
                                    <div class="f-l"style="margin-left: 15px;">
                                        <div class="tpd-goods-name tpd-cdiy-font28">列表名称 : <input onblur="tab_title(this);" class="maxword-input-js" data-classid="10" data-maxlength="8" type="text" value="列表名称1" /><span><i class="now-words">4</i>/8</span></div>
                                        <dl class="tpd-cstyle-dl clearfix">
                                            <dt>选取商品 : </dt>
                                            <dd><label><input class="screen" type="radio" name="goods-style4" />按条件选取</label></dd>
                                            <dd><label><input type="radio" class="hand1" name="goods-style4" />手动添加</label></dd>
                                        </dl>
                                    </div>
                                    <div class="tpd-cdiy-identity"><img src="__PUBLIC__/static/images/ico-diy-drag.png" alt="" /></div>
                                    <a class="tpd-del-nav" href="javascript:;"></a>
                                </li>
                            </ul>
                        </div>
                        <script>
                            function setSdiles(){
                                /*【快捷入口】链接目标下拉列表*/
                                $('.tpd-goods-style').find('.tpd-select-wrap').click(function (e) {
                                    $(this).toggleClass('tpd-select-ac');
                                    var target=$(e.target);
                                    if(target.is($(this).find('li'))){
                                        $(this).find('span').html(target.text());
                                    }
                                });

                                var viewAc='.tpd-edits-hidden.tpd-editing';
                                $('#goods-style').find('label').click(function () { //切换商品列表样式
                                    $(viewAc).find('.tpdm-goods-list').removeClass('tpdm-goods-list1 tpdm-goods-list2 tpdm-goods-list3').addClass('tpdm-goods-list'+$(this).attr('data-listid'));
                                    block[divid].show_type=$(this).find('input').val();
                                });
                                $('#goodIds-num').find('label').click(function () { //切换商品数量
                                    var viewNum=parseInt($(this).text());
                                    var num=$(viewAc).find('.containers-slider-wrap .containers-slider-item').length;
                                    if(num<viewNum){
                                        for(var i=num;i<viewNum;i++){
                                            $(viewAc).find('.containers-slider-wrap .containers-slider-cont').append($(viewAc).find('.containers-slider-wrap .containers-slider-item:last').clone());
                                        }
                                    }else{
                                        for(var j=num;j>viewNum;j--){
                                            $(viewAc).find('.containers-slider-wrap .containers-slider-item:last').remove();
                                        }
                                    }
                                });
                                $('#goods_order').find('li').click(function(){
                                    block[divid].order=$(this).index();
                                    $.post("{:U('Admin/Block/goods_list_block')}",{'num':block[divid].num,'order':block[divid].order},function(res){
                                        $(viewAc).find('.tpdm-goods-list ul').html(res.result);
                                    },'JSON');
                                })


                            }
                            setSdiles()
                        </script>
                    </div>   
                    <div class="tpd-diy-js tpd-activity">
                        <div class="tpd-diy-title">底部菜单栏设置</div>
                        <div class="tpd-cstyle-select tpd-cdiy-font28">
                            <label>营销活动 :</label>
                            <div class="tpd-select-wrap">
                                <span id="activity_show">拼团</span>
                                <ul class="tpd-select-list">
                                    <li data-index="0" onclick="activity_choice(this)">拼团</li>
                                    <li data-index="1" onclick="activity_choice(this)">秒杀</li>
                                </ul>
                            </div>
                        </div>
                        <label class="tpd-diy-bb tpd-cdiy-font28">下间距 :<input type="text" value="10" />px</label>
                        <div class="tpd-activity-list">
                            <div class="tpd-activity-item tpd-activity-item1 tpd-activity-ac">
                                <dl class="tpd-cstyle-dl clearfix" id="activity-title">
                                    <dt>列表名称 : </dt>
                                    <dd><label data-showtitle="0"><input type="radio" name="activity1" />不使用</label></dd>
                                    <dd style="margin-top: -6px;"><label  data-showtitle="1"><input type="radio" name="activity1" checked />使用</label><div class="tpd-activity-name tpd-cdiy-font28"><input onblur="activity_title(this)" class="maxword-input-js" data-classid="14" data-maxlength="10" type="text" placeholder="请输入活动标题" /><span><i class="now-words">0</i>/10</span></div></dd>
                                </dl>
                                <!--div class="tpd-cdiy-font28">
                                    <label>选择商品 : </label>
                                    <div class="tpd-addlink-target"><span>＋</span>　添加商品</div>
                                </div-->
                                <dl class="tpd-cstyle-dl clearfix" id="activity-style">
                                    <dt>显示布局 : </dt>
                                    <dd><label data-listid="1"><input onblur="activity_tit_set(0)" type="radio" name="activity2" checked="checked" /><i class="tpd-cstyle-ico2"></i>橱窗式</label></dd>
                                    <dd><label data-listid="2"><input onblur="activity_tit_set(1)" type="radio" name="activity2" /><i class="tpd-cstyle-ico1"></i>列表式</label></dd>
                                </dl>
                            </div>

                            <div class="tpd-activity-item">
                                <!--ul class="tpd-activity-seckill tpd-cdiy-list">
                                    <li>
                                        <div class="tpd-wstyle-uploadimg">
                                            <span></span>
                                            <label>建议宽度750zpx，高度312px<br />
                                                如尺寸不达标，图片将自适应显示</label>
                                        </div>
                                        <div class="tpd-wstyle-addlink">
                                            <span>链接设置</span>
                                            <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                            <label>请先上传图片</label>
                                        </div>
                                        <div class="tpd-cdiy-identity">①</div>
                                    </li>
                                    <li>
                                        <div class="tpd-wstyle-uploadimg">
                                            <span></span>
                                            <label>建议宽度750zpx，高度312px<br />
                                                如尺寸不达标，图片将自适应显示</label>
                                        </div>
                                        <div class="tpd-wstyle-addlink">
                                            <span>链接设置</span>
                                            <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                            <label>请先上传图片</label>
                                        </div>
                                        <div class="tpd-cdiy-identity">②</div>
                                    </li>
                                    <li>
                                        <div class="tpd-wstyle-uploadimg">
                                            <span></span>
                                            <label>建议宽度750zpx，高度312px<br />
                                                如尺寸不达标，图片将自适应显示</label>
                                        </div>
                                        <div class="tpd-wstyle-addlink">
                                            <span>链接设置</span>
                                            <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                            <label>请先上传图片</label>
                                        </div>
                                        <div class="tpd-cdiy-identity">③</div>
                                    </li>
                                    <li>
                                        <div class="tpd-wstyle-uploadimg">
                                            <span></span>
                                            <label>建议宽度750zpx，高度312px<br />
                                                如尺寸不达标，图片将自适应显示</label>
                                        </div>
                                        <div class="tpd-wstyle-addlink">
                                            <span>链接设置</span>
                                            <div class="tpd-addlink-target"><i></i>添加链接目标</div>
                                            <label>请先上传图片</label>
                                        </div>
                                        <div class="tpd-cdiy-identity">④</div>
                                    </li>
                                </ul-->
                            </div>

                        </div>
                        <script>
                            function setActivity() {
                                var viewAc='.tpd-edits-hidden.tpd-editing';
                                /*【营销活动】活动类型下拉列表*/
                                $('.tpd-activity').find('.tpd-select-wrap').click(function (e) {
                                    $(this).toggleClass('tpd-select-ac');
                                    var target=$(e.target);
                                    if(target.is($(this).find('li'))){
                                        var i=target.attr('data-index');
                                        $(this).find('span').html(target.text());
                                        $('.tpd-activity-item').eq(i).addClass('tpd-activity-ac').siblings().removeClass('tpd-activity-ac');
                                        $(viewAc).find('.js-code-wrap').html(diyHtml['tpd-activity'][i]);
                                        if(i==0){ //切换到拼团
                                            //(还原是否显示标题)
                                            var showtitle=  $('#activity-title').find('input[checked]').parents('label').attr('data-showtitle');
                                            if(showtitle==0){
                                                $(viewAc).find('.tpdm-activity-title').hide();
                                            }else {
                                                $(viewAc).find('.tpdm-activity-title').show();
                                            }
                                            //(还原是橱窗还是列表)
                                            var listid=$('#activity-style').find('input[checked]').parents('label').attr('data-listid');
                                            $(viewAc).find('.tpdm-goods-list').removeClass('tpdm-goods-list1 tpdm-goods-list2').addClass('tpdm-goods-list'+listid);
                                        }else{ //切换到秒杀

                                        }
                                    }
                                });
                                $('#activity-title').find('label').click(function () { //显示标题
                                    $(this).find('input').attr('checked','checked');
                                    $(this).parents('dd').siblings().find('input').removeAttr('checked');
                                    var title=$(viewAc).find('.tpdm-activity-title');
                                    if($(this).attr('data-showtitle')==0){
                                        title.hide();
                                    }else {
                                        title.show();
                                    }
                                });
                                $('#activity-style').find('label').click(function () { //设置活动样式
                                    $(this).find('input').attr('checked','checked');
                                    $(this).parents('dd').siblings().find('input').removeAttr('checked');
                                    $(viewAc).find('.tpdm-goods-list').removeClass('tpdm-goods-list1 tpdm-goods-list2').addClass('tpdm-goods-list'+$(this).attr('data-listid'));

                                });
                            }
                            setActivity();
                        </script>
                    </div>
                    <div class="tpd-diy-js tpd-coupon">
                        <div class="tpd-diy-title">优惠券设置</div>
                        <dl class="tpd-cstyle-dl clearfix" id="coupon-style">
                            <dt>优惠券样式 : </dt>
                            <dd><label data-index="0"><input type="radio" name="coupon1" checked />样式1</label></dd>
                            <dd><label data-index="1"><input type="radio" name="coupon1" />样式2</label></dd>
                        </dl>
                        <label class="tpd-diy-bb tpd-cdiy-font28">下间距 :<input type="text" value="10" />px</label>
                        <div class="tpd-cdiy-font28">
                            <label class="f-l">优惠券 : </label>
                            <div class="tpd-coupon-list" id="coupon-list">
                                <!--ul>
                                    <li><span>满200减50</span><i class="tpd-coupon-close"></i></li>
                                </ul-->
                                <div class="tpd-addlink-target" id="add_coupon"><span>＋</span>　添加优惠券</div>
                            </div>
                        </div>
                        <script>
                            $('#coupon-style').find('label').click(function () { /*切换优惠券样式*/
                                $('.tpd-edits-hidden.tpd-editing').find('.js-code-wrap').html(diyHtml['tpd-coupon'][$(this).attr('data-index')]);
                                block[divid]['coupon_style']=$(this).attr('data-index');
                                block[divid].nav=[];
                                $('.pop-swith').removeClass('pop-swith-on');
                            });
                            $('#coupon-list').on('click','.tpd-coupon-close',function () {  //删除优惠券
                                $(this).parents('li').remove();
                                
                            })
                        </script>
                    </div>
                    <div class="tpd-diy-js tpd-search">
                        <div class="tpd-diy-title">搜索栏设置</div>
                        <ul class="tpd-search-list">
                            <li>
                                <div class="tpd-search-warp clearfix">
                                	<div class="tpd-search-tm"></div>
                                    <a class="tpd-logo" href="javascript:;"><img src="__PUBLIC__/static/images/logo.png" alt="" /></a>
                                    <form class="tpd-search-form" action="">
                                        <i class="ico-head-search"></i>
                                        <a href="javascript:;"><input type="text" placeholder="请输入您所搜索的商品" /></a>
                                    </form>
                                    <a class="tpd-personal-warp" href="javascript:;">
                                        <span>登录</span>
                                        <i class="ico-head-personal"></i>
                                    </a>
                                </div>
                                <a class="tpd-cmodule-radio radio-selected" href="javascript:;"></a>
                            </li>
                            <li>
                                <div class="tpd-search-warp tpd-search-wrap1 clearfix">
                                	<div class="tpd-search-tm"></div>
                                    <a class="tpd-logo" href="javascript:;"><img src="__PUBLIC__/static/images/logo.png" alt="" /></a>
                                    <form class="tpd-search-form" action="">
                                        <i class="ico-head-search"></i>
                                        <a href="javascript:;"><input type="text" placeholder="请输入您所搜索的商品" /></a>
                                    </form>
                                    <a class="tpd-personal-warp" href="javascript:;">
                                        <span>登录</span>
                                        <i class="ico-head-personal"></i>
                                    </a>
                                </div>
                                <a class="tpd-cmodule-radio" href="javascript:;"></a>
                            </li>
                            <li>
                                <div class="tpd-search-warp tpd-search-wrap2 clearfix">
                                	<div class="tpd-search-tm"></div>
                                    <a class="tpd-logo" href="javascript:;"><img src="__PUBLIC__/static/images/logo.png" alt="" /></a>
                                    <form class="tpd-search-form" action="">
                                        <i class="ico-head-search"></i>
                                        <a href="javascript:;"><input type="text" placeholder="请输入您所搜索的商品" /></a>
                                    </form>
                                    <a class="tpd-personal-warp" href="javascript:;">
                                        <span>登录</span>
                                        <i class="ico-head-personal"></i>
                                    </a>
                                </div>
                                <a class="tpd-cmodule-radio" href="javascript:;"></a>
                            </li>
                            <script>
                                $('.tpd-search .tpd-cmodule-radio').click(function () {
                                    $('.tpd-search .tpd-cmodule-radio').removeClass('radio-selected');
                                    $(this).addClass('radio-selected');
                                    var html=$(this).parents('li').find('.tpd-search-warp').clone();
                                    $('.tpdm-head-wrap.tpdm-head-edit').find('.tpdm-head-js').html(html);
                                    block[divid]['search_style']=$(this).parents('li').index();
                                });
                            </script>
                        </ul>
                    </div>
                    <div class="tpd-diy-js tpd-storeh">
                        <div class="tpd-diy-title">店铺头部设置</div>
                        <label class="tpd-diy-bb tpd-cdiy-font28">下间距 :<input type="text" value="10" />px</label>
                        <ul class="tpd-storeh-list clearfix">
                            <li>
                                <div class="tpd-storeh-wrap clearfix">
                                    <div class="tpd-store-head">
                                        <div class="tpd-storeh-cont tpd-storeh-cont1">
                                            <a class="tpd-storeh-logo" href="javascript:;"><img src="__PUBLIC__/static/images/logo.png" alt="" /></a>
                                            <div class="tpd-storeh-name"><span>店铺名称</span><i class="tpd-storeh-collect">收藏</i></div>
                                            <div class="tpd-storeh-des">一句话介绍你的店铺</div>
                                        </div>
                                    </div>
                                </div>
                                <a class="tpd-cmodule-radio radio-selected" href="javascript:;"></a>
                            </li>
                            <li>
                                <div class="tpd-storeh-wrap clearfix">
                                    <div class="tpd-store-head">
                                        <div class="tpd-storeh-cont1 tpd-storeh-cont2">
                                            <a class="tpd-storeh-logo" href="javascript:;"><img src="__PUBLIC__/static/images/logo.png" alt="" /></a>
                                            <div class="tpd-storeh-name"><span>店铺名称</span><i class="tpd-storeh-collect">收藏</i></div>
                                            <div class="tpd-storeh-des">一句话介绍你的店铺</div>
                                        </div>
                                        <ul class="tpd-storeh-num">
                                            <li>
                                                <i>126</i>
                                                <span>全部商品</span>
                                            </li>
                                            <li>
                                                <i>5642</i>
                                                <span>收藏数量</span>
                                            </li>
                                            <li>
                                                <i>28</i>
                                                <span>新品上市</span>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                                <a class="tpd-cmodule-radio" href="javascript:;"></a>
                            </li>
                            <li>
                                <div class="tpd-storeh-wrap clearfix">
                                    <div class="tpd-store-head">
                                        <div class="tpd-storeh-cont3">
                                            <a class="tpd-storeh-logo" href="javascript:;"><img src="__PUBLIC__/static/images/logo.png" alt="" /></a>
                                            <div class="tpd-storeh-name">店铺名称</div>
                                            <i class="tpd-storeh-collect">收藏</i>
                                        </div>
                                        <ul class="tpd-storeh-num">
                                            <li>
                                                <i>126</i>
                                                <span>全部商品</span>
                                            </li>
                                            <li>
                                                <i>5642</i>
                                                <span>收藏数量</span>
                                            </li>
                                            <li>
                                                <i>28</i>
                                                <span>新品上市</span>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                                <a class="tpd-cmodule-radio" href="javascript:;"></a>
                            </li>
                            <li>
                                <div class="tpd-storeh-wrap clearfix">
                                    <div class="tpd-store-head">
                                        <div class="tpd-storeh-cont3 tpd-storeh-cont4">
                                            <a class="tpd-storeh-logo" href="javascript:;"><img src="__PUBLIC__/static/images/logo.png" alt="" /></a>
                                            <div class="tpd-storeh-name">店铺名称</div>
                                            <div class="tpd-storeh-des">一句话介绍你的店铺</div>
                                            <i class="tpd-storeh-collect">收藏</i>
                                        </div>

                                    </div>
                                </div>
                                <a class="tpd-cmodule-radio" href="javascript:;"></a>
                            </li>
                            <li>
                                <div class="tpd-storeh-wrap clearfix">
                                    <div class="tpd-store-head">
                                        <div class="tpd-storeh-cont1 tpd-storeh-cont5">
                                            <a class="tpd-storeh-logo" href="javascript:;"><img src="__PUBLIC__/static/images/logo.png" alt="" /></a>
                                            <div class="tpd-storeh-name"><span>店铺名称</span><i class="tpd-storeh-collect">收藏</i></div>
                                        </div>

                                    </div>
                                </div>
                                <a class="tpd-cmodule-radio" href="javascript:;"></a>
                            </li>
                            <li class="tpd-eidt-storeh"></li>
                            <script>
                                $('.tpd-storeh-list .tpd-cmodule-radio').click(function () {
                                    $('.tpd-storeh-list .tpd-cmodule-radio').removeClass('radio-selected');
                                    $(this).addClass('radio-selected');
                                    var html=$(this).parents('li').find('.tpd-store-head').clone();
                                    $('.tpd-edits-hidden.tpd-editing').find('.js-code-wrap').html(html);

                                });
                            </script>
                        </ul>
                    </div>
                    <div class="tpd-diy-js tpd-message">
                        <div class="tpd-diy-title">公告设置</div>
                        <div class="tpd-mes-style">
                            <div class="tpd-mes-uploadimg" onclick="getpath(this);">公告图片 : <a href="javascript:;" id="notice_pic"><img src="__PUBLIC__/static/images/pic-mes-upload.jpg" alt="" /></a></div>
                            <label class="tpd-diy-bb tpd-cdiy-font28">下间距 :<input type="text" value="10" />px</label>
                        </div>
                        <ul class="tpd-cdiy-list">
                            <li class="tpd-meslist1">
                                <div class="tpd-mes-set">
                                    <div class="tpd-mes-name tpd-cdiy-font28">公告标签 : <input id="nt0" onblur="notice_edit(this,'tit',0);" class="maxword-input-js" data-classid="1" data-maxlength="2" type="text" /><span><i class="now-words">0</i>/2</span></div>
                                    <div class="tpd-mes-addlink tpd-cdiy-font28">
                                        <label>链接设置 : </label>
                                        <div class="tpd-addlink-target" id="nu0"><i></i>添加链接目标</div>
                                    </div>
                                </div>
                                <div class="tpd-mes-cont tpd-cdiy-font28">公告内容 : <input id="nc0" onblur="notice_edit(this,'con',0);" class="maxword-input-js" data-classid="2" data-maxlength="30" type="text" placeholder="此处填写公告内容" /><span><i class="now-words">0</i>/30</span></div>
                                <div class="tpd-cdiy-identity">①</div>
                            </li>
                            <li class="tpd-meslist2">
                                <div class="tpd-mes-set">
                                    <div class="tpd-mes-name tpd-cdiy-font28">公告标签 : <input id="nt1" onblur="notice_edit(this,'tit',1);" class="maxword-input-js" data-classid="3" data-maxlength="2" type="text" /><span><i class="now-words">0</i>/2</span></div>
                                    <div class="tpd-mes-addlink tpd-cdiy-font28">
                                        <label>链接设置 : </label>
                                        <div class="tpd-addlink-target" id="nu1"><i></i>添加链接目标</div>
                                    </div>
                                </div>
                                <div class="tpd-mes-cont tpd-cdiy-font28">公告内容 : <input id="nc1" onblur="notice_edit(this,'con',1);" class="maxword-input-js" data-classid="4" data-maxlength="30" type="text" placeholder="此处填写公告内容" /><span><i class="now-words">0</i>/30</span></div>
                                <div class="tpd-cdiy-identity">②</div>
                            </li>
                            <script>
                            //参数
                            function setInputVal(input,showEle){
                                $(input).blur(function () {
                                    console.log(119,$(this).val());
                                    $('.tpd-edits-hidden.tpd-editing').find(showEle).html($(this).val());
                                });
                            };
                            setInputVal('.tpd-meslist1 .tpd-mes-name>input','.tpdm-mesname1');
                            setInputVal('.tpd-meslist2 .tpd-mes-name>input','.tpdm-mesname2');
                            setInputVal('.tpd-meslist1 .tpd-mes-cont>input','.tpdm-mescont1');
                            setInputVal('.tpd-meslist2 .tpd-mes-cont>input','.tpdm-mescont2');
                            </script>
                        </ul>
                    </div>
                    <div class="tpd-diy-js tpd-footmenu">
                        <div class="tpd-diy-title">底部菜单栏设置</div>
                        <ul class="tpd-footmenu-list">
                            <li>
                                <div class="tpd-footer tpd-footer1" id="footer1">
                                    <a class="footmenu-ac" href="/mobile/Index/index">
                                        <i class="ico-foot1"></i>
                                        <span>首页</span>
                                    </a>
                                    <a href="/mobile/Goods/categoryList.html">
                                        <i class="ico-foot2"></i>
                                        <span>分类</span>
                                    </a>
                                    <a href="/mobile/Cart/index">
                                        <i class="ico-foot4"></i>
                                        <span>购物车</span>
                                    </a>
                                    <a href="/Mobile/User/login">
                                        <i class="ico-foot5"></i>
                                        <span>我的</span>
                                    </a>
                                </div>
                                <a onclick="change_footer(0);" class="tpd-cmodule-radio radio-selected" href="javascript:;"></a>
                            </li>
                            <li>
                                <div class="tpd-footer tpd-footer2" id="footer2">
                                    <a class="footmenu-ac" href="/mobile/Index/index">
                                        <i class="ico-foot1"></i>
                                        <span>首页</span>
                                    </a>
                                    <a href="/mobile/Goods/categoryList.html">
                                        <i class="ico-foot2"></i>
                                        <span>分类</span>
                                    </a>
                                    <a href="/mobile/Goods/ajaxSearch">
                                        <i class="ico-foot3"></i>
                                        <span>发现</span>
                                    </a>
                                    <a href="/mobile/Cart/index">
                                        <i class="ico-foot4"></i>
                                        <span>购物车</span>
                                    </a>
                                    <a href="/Mobile/User/login">
                                        <i class="ico-foot5"></i>
                                        <span>我的</span>
                                    </a>
                                </div>
                                <a onclick="change_footer(1);" class="tpd-cmodule-radio" href="javascript:;"></a>
                            </li>
                            <script>
                                $('.tpd-footmenu .tpd-cmodule-radio').click(function () {
                                    block.footer_type=$(this).parents('li').index();
                                    $('.tpd-cmodule-radio').removeClass('radio-selected');
                                    $(this).addClass('radio-selected');
                                    var html1=$(this).parents('li').find('.tpd-footer').clone();
                                    var html2=$(this).parents('li').find('.tpd-footer').clone();
                                    if($('.tpdm-footer-false').hasClass('tpdm-footf-edit')){
                                        $('.tpdm-footer-wrap').html(html1);
                                        $('.tpdm-footer-false').find('.tpdm-footf-js').html(html2);
                                    }
                                });
                            </script>
                        </ul>
                    </div>
                </div>
                <div class="tpd-foot-wrap">
                    <div class="tpd-foot">
                        <!--i class="ico-radio1"></i-->
                        <!--label>设为当前使用模板</label-->
                        <a href="javascript:;" onclick="save_data();">保 存</a>
                        <!--a href="javascript:;">预 览</a-->
                    </div>
                    <script>
                        $('.tpd-foot>.ico-radio1').click(function () {
                            $(this).toggleClass('radio1-selected');
                        });
                    </script>
                </div>
            </div>
        </div>
    </div>
</div>
<div id="json_str" style="display:none"><?php echo $info; ?></div>
<input type="hidden" id="do_edit" value="{$id}"> 

<script src="__PUBLIC__/static/js/tp-drag.js"></script>

<!--弹窗部分-->
<div class="shade-module"  id="shade-module" style="display:none"></div>
<!--链接目标-->
<div class="pop-warp pop-link" id="pop-link" style="display:none">
    <div class="pop-title">链接目标</div>
    <a class="close-pop-btn" href="javascript:;"></a>
    <div class="pop-menu pop-link-menu">
        <a class="link-menu-ac" href="javascript:;">输入链接</a>
        <a href="javascript:;">商城页面</a>
        <a href="javascript:;">商品分类</a>
        <a href="javascript:;">商品详情</a>
        <a href="javascript:;">自定义页面</a>
    </div>
    <ul class="pop-link-list">
        <li class="pop-link-ac">
            <dl class="pop-input-link tpd-cdiy-font28">
                <dt>链接地址：</dt>
                <dd><label>http://<input id="url1" type="text" /></label></dd>
                <dd><label><input id="url0" type="radio" name="link-target1" />无连接</label></dd>
            </dl>
        </li>
        <li>
            <dl class="pop-link-mall pop-clink-wrap tpd-cdiy-font28" id="shop_link">
                <dt>选择页面：</dt>
                <dd><label><input type="radio" name="link-target2" value="{:U('Mobile/index/index')}" />商城首页</label></dd>
                <dd><label><input type="radio" name="link-target2" value="{:U('Mobile/Cart/index')}" />购物车</label></dd>
                <dd><label><input type="radio" name="link-target2" value="{:U('Mobile/activity/coupon_list')}" />优惠券中心</label></dd>
                <dd><label><input type="radio" name="link-target2" value="{:U('Mobile/Team/index')}" />拼团页面</label></dd>
                <dd><label><input type="radio" name="link-target2" value="{:U('Mobile/Activity/flash_sale_list')}" />限时秒杀</label></dd>
                <dd><label><input type="radio" name="link-target2" value="{:U('Mobile/Goods/categoryList')}" />商品分类</label></dd>
                <dd><label><input type="radio" name="link-target2" value="{:U('Mobile/User/index')}" />会员中心</label></dd>
                <dd><label><input type="radio" name="link-target2" value="{:U('Mobile/Goods/integralMall')}" />积分商城</label></dd>
                <dd><label><input type="radio" name="link-target2" value="{:U('Mobile/Distribut/index')}" />我的分销</label></dd>
            </dl>
        </li>
        <li>
            <div class="pop-link-goodscategory clearfix">
                <div class="tpd-cstyle-select tpd-cdiy-font28">
                    <label>一级分类 : </label>
                    <div>
                      <select name="cat_id" id="cat_id"  class="small form-control">
                        <option value="0">请选择商品分类</option>                                      
                             <foreach name="cat_list" item="v" key="k" >                                                                                 
                               <option value="{$v['id']}" <if condition="$v['id'] eq $level_cat['1']">selected="selected"</if> >
                                    {$v['name']}
                               </option>
                             </foreach>
                      </select>
                    </div>
                </div>
                <div class="tpd-cstyle-select tpd-cdiy-font28">
                    <label>二级分类 : </label>
                    <div>
                      <select name="cat_id_2" id="cat_id_2" onChange="get_class_2(this);" class="small form-control">
                        <option value="0">请选择商品分类</option>
                      </select>
                    </div>
                </div>
                <div class="tpd-cstyle-select tpd-cdiy-font28">
                    <label>三级分类 : </label>
                    <div>
                      <select name="cat_id_3" id="cat_id_3" onchange="goods_class();" class="small form-control">
                        <option value="0">请选择商品分类</option>
                      </select>  
                    </div>
                </div>
            </div>
            <style type="text/css">
                .pop-link-goodscategory{
                    min-height: 100px;
                }
                .pop-links-des{
                    width: 700px;
                    margin:0 auto;
                    font-size: 18px;
                    color: #666;
                    padding: 10px;
                    border: 1px solid #ccc;
                    line-height: 24px;
                }
            </style>
            <div class="pop-links-des" id="url_show"></div>
            <script>
            //get_category(this.value,'cat_id_3','0');
                /*【弹窗-商品分类】下拉列表*/
                $('.pop-link-goodscategory').find('.tpd-select-wrap').click(function (e) {
                    $(this).toggleClass('tpd-select-ac');
                    var target=$(e.target);
                    if(target.is($(this).find('li'))){
                        $(this).find('span').html(target.text());
                    }
                });
            </script>
        </li>
        <li>
            <form class="pop-search pop-goods-search">
                <input type="text" id="goods_keywords" placeholder="搜索商品名称" />
                <input type="hidden" id="search_history" value="{$keywords}" />
                <a id="goods_search" href="javascript:;"></a>
            </form>
            <ul class="pop-goods-detail">
                <li class="p-li0"><input type="checkbox" value=" " /></li>
                <li class="p-li1">商品编码</li>
                <li class="p-li2">商品名称</li>
                <li class="p-li3">商品图片</li>
                <li class="p-li4">商品分类</li>
                <li class="p-li4">商品价格</li>
                <li class="p-li4">商品库存</li>
            </ul>
            <div class="pop-goods-detail p-goods-list">
                <div class="p-goods-scroll">

                <volist name="goodsList" id="vo">
                    <ul class="p-goods-item">
                        <li class="pi-li0"><input type="checkbox" value="{$vo.goods_id}" /></li>
                        <li class="pi-li1">{$vo.goods_id}</li>
                        <li class="pi-li2">{$vo.goods_name}</li>
                        <li class="pi-li3"><img src="{$vo.original_img}" alt="" /></li>
                        <li class="pi-li4">{$vo.cat_id}</li>
                        <li class="pi-li4">{$vo.shop_price}</li>
                        <li class="pi-li4">{$vo.store_count}</li>
                    </ul>
                </volist>
                </div>
            </div>
            <div class="pop-goods-paging">
                <span><i id="page">1</i>/<i id="count">{$count}</i></span>
                <a onclick="page_show(1);" href="javascript:;">&gt;</a>
                <a onclick="page_show(0);" href="javascript:;">&lt;</a>
            </div>
        </li>
        <li>
            <dl class="pop-link-mall pop-clink-wrap tpd-cdiy-font28">
                <dt>选择页面：</dt>
                <volist name="page_list" id="vo">
                    <dd><label><input template-id="{$vo.id}" class="diyPage" type="radio" name="link-target5" />{$vo.template_name}</label></dd>
                </volist>
            </dl>
        </li>
    </ul>
    <div class="pop-link-btns">
        <a href="javascript:;" id="link-cancel">取消</a>
        <a href="javascript:;" id="link-ok">确定</a>
    </div>
    <script>
        function popLink() {
            $('.pop-link-menu>a').click(function () {  //切换列表
                $(this).addClass('link-menu-ac').siblings().removeClass('link-menu-ac');
                $('.pop-link-list>li').eq($(this).index()).addClass('pop-link-ac').siblings().removeClass('pop-link-ac');
                url_type=$(this).index();
            });
            var closeBtn=$('.pop-link>.close-pop-btn');
            closeBtn.click(function () {  //关闭弹窗
                $('#shade-module').fadeOut();
                $('#pop-link').slideUp();
            })
            $('#link-cancel').click(function () {  //取消
//            do something...
                closeBtn.trigger('click');
            })
            $('#link-ok').click(function () {  //弹窗选择链接确定
                //各个板块内的添加链接按钮 弹窗内设置完链接之后 添加链接按钮的输入框实时显示
                $(link).html(url_tmp);
                switch(choice_type){
                    case '0':
                        block[divid].url=url_tmp;
                        block[divid].url_type=url_type;
                        $('.tpd-edits-hidden.tpd-editing .js-code-wrap').find('a').attr('href',url_tmp);  
                        break;

                    case '1':
                        var j=$(link).parents('li').index();
                        block[divid].nav[j].url=url_tmp;
                        var viewUl=$('.tpd-edits-hidden.tpd-editing').find('.tpdm-carousel');
                        viewUl.find('li').eq(j+1).find('a').attr('href',url_tmp);
                        break;

                    case '2':
                        var i=$(link).parents('li').index();
                        block[divid].nav[i].url=url_tmp;           
                        var viewUl=$('.tpd-edits-hidden.tpd-editing').find('.tpdm-navstyle');
                        viewUl.find('a').eq(i).attr('href',url_tmp);
                        break;

                    case '3':
                        
                        break;

                    case '4':
                        var i=parseInt($(link).parents('li').index());
                        block[divid].nav[i].url=url_tmp;
                        var viewUl=$('.tpd-edits-hidden.tpd-editing').find('.tpdm-wstyle');
                        viewUl.find('a').eq(i).attr('href',url_tmp); 
                        break;

                    case '5':
                        block[divid].url=url_tmp;
                        $('.tpd-edits-hidden.tpd-editing').find('a').attr('href',url_tmp);
                        break;

                    case '10':
                        var i=($(link).parents('li').index());
                        block[divid].nav[i].url=url_tmp;
                        $('.tpd-edits-hidden.tpd-editing').find('.tpdm-mes-cont').find('a').eq(i).attr('href',url_tmp);
                        break;
                }


                closeBtn.trigger('click');
            })
        }
        popLink();

        //手动输入链接时
        $('#url1').blur(function(){
            url_tmp='http://'+$('#url1').val();
        });
        $('#url0').click(function(){
            url_tmp='';
        });

        //选择商城页面时
        $('#shop_link').find('input').click(function(){
            url_tmp=$(this).val();
        })

        //选择自定义页面时
        $('.diyPage').click(function(){
            var tid=$(this).attr('template-id');
            url_tmp='/mobile/index/index2/'+tid;
        });


        $(".p-goods-list").on('click','input',function(){
            if($(this).attr('checked')=='checked'){
                $(this).removeAttr('checked');
            }else{
                $(this).attr('checked','checked');
                //弹窗选择商品详情作链接
                url_tmp='/index.php?m=Mobile&c=Goods&a=goodsInfo&id='+$(this).val();
                $(this).parents('.p-goods-item').siblings().find('input').removeAttr('checked');   //可强制设为单选
            }
        });

        function get_class_2(a){
            var tmp="{:U('Mobile/Goods/goodsList')}";
            tmp+="/id/"+$(a).val()+".html";
            url_tmp=tmp;
            $('#url_show').html(url_tmp);

            get_category($(a).val(),'cat_id_3','0');
        }

        function goods_class(){
            var tmp="{:U('Mobile/Goods/goodsList')}";
            tmp+="/id/"+$('#cat_id_3').val()+".html";
            url_tmp=tmp;
            $('#url_show').html(url_tmp);
        }

        $('#goods_search').click(function(){
            var keywords=$('#goods_keywords').val();
            ajax_goods_list(keywords,1);
            $('#search_history').val(keywords);
            $('#page').html(1);
        })

        function page_show(status){
            var page=parseInt($('#page').html());
            if(status==0){
                page=page-1;
                if(page<1){
                    page=1;
                    return;
                }
            }
            if(status==1){
                page=page+1;
                if(page>parseInt($('#count').html())){
                    page=parseInt($('#count').html());
                    return;
                }
            }
            $('#page').html(page);
            var keywords=$('#search_history').val();
            ajax_goods_list(keywords,page);
        }

        function ajax_goods_list(keywords,page) {
            $.ajax({
                type: "POST",
                url: "/index.php?m=Admin&c=block&a=ajaxGoodsList",
                data: {'keywords':keywords,'page':page},
                dataType:'json',
                success: function (res) {
                    var r=res.result;
                    if(r.html){
                        $('.pop-goods-detail.p-goods-list').html(r.html);
                    }
                    if(r.count){
                        $('#count').html(r.count);
                    }
                }
            });
        }

    </script>

    <script>
    //选择分类
    $(function(){
        $(document).on("change",'#cat_id',function(){
            get_category($(this).val(),'cat_id_2','0');

            var tmp="{:U('Mobile/Goods/goodsList')}";
            tmp+="/id/"+$(this).val()+".html";
            url_tmp=tmp;
            $('#url_show').html(url_tmp);

            $('#cat_id_3').empty().html("<option value='0'>请选择商品分类</option>");
        })
    })
    $(function(){
        $(document).on("change",'#extend_cat_id',function(){
            get_category($(this).val(),'extend_cat_id_2','0');

            var tmp="{:U('Mobile/Goods/goodsList')}";
            tmp+="/id/"+$(this).val()+".html";
            url_tmp=tmp;
            $('#url_show').html(url_tmp);

            $('#extend_cat_id_3').empty().html("<option value='0'>请选择商品分类</option>");
        })
    })
    $(function(){
        $(document).on("click",'.is_virtual',function(){
            initIsVirtual();
        })
    })

/** 以下是编辑时默认选中某个商品分类*/
$(document).ready(function(){

    <if condition="$level_cat['2'] gt 0">
         // 商品分类第二个下拉菜单
         get_category('{$level_cat[1]}','cat_id_2','{$level_cat[2]}');  
    </if>
    <if condition="$level_cat['3'] gt 0">
        // 商品分类第二个下拉菜单
         get_category('{$level_cat[2]}','cat_id_3','{$level_cat[3]}');   
    </if>

    //  扩展分类
    <if condition="$level_cat2['2'] gt 0">
         // 商品分类第二个下拉菜单
         get_category('{$level_cat2[1]}','extend_cat_id_2','{$level_cat2[2]}'); 
    </if>
    <if condition="$level_cat2['3'] gt 0">
        // 商品分类第二个下拉菜单
         get_category('{$level_cat2[2]}','extend_cat_id_3','{$level_cat2[3]}');  
    </if>

});
</script>
</div>



<!--商品列表商品详情-->
<div class="pop-warp pop-link" id="pop-link2" style="display:none">
    <div class="pop-title">选择商品</div>
    <a class="close-pop-btn" href="javascript:;"></a>
    <div class="pop-menu pop-link-menu">
        <a href="javascript:;">商品列表</a>
    </div>
    <ul class="pop-link-list">
        <li class="pop-link-ac">
            <form class="pop-search pop-goods-search">
                <input type="text" id="goods_keywords2" placeholder="搜索商品名称" />
                <input type="hidden" id="search_history2" value="{$keywords}" />
                <a id="goods_search2" href="javascript:;"></a>
            </form>
            <ul class="pop-goods-detail">
                <li class="p-li0"><input type="checkbox" value=" " /></li>
                <li class="p-li1">商品编码</li>
                <li class="p-li2">商品名称</li>
                <li class="p-li3">商品图片</li>
                <li class="p-li4">商品分类</li>
                <li class="p-li4">商品价格</li>
                <li class="p-li4">商品库存</li>
            </ul>
            <div class="pop-goods-detail p-goods-list" id="p-goods-list">
                <div class="p-goods-scroll" id="choice_goods_list">

                <volist name="goodsList" id="vo">
                    <ul class="p-goods-item">
                        <li class="pi-li0"><input type="checkbox" value="{$vo.goods_id}" /></li>
                        <li class="pi-li1">{$vo.goods_id}</li>
                        <li class="pi-li2">{$vo.goods_name}</li>
                        <li class="pi-li3"><img src="{$vo.original_img}" alt="" /></li>
                        <li class="pi-li4">{$vo.cat_id}</li>
                        <li class="pi-li4">{$vo.shop_price}</li>
                        <li class="pi-li4">{$vo.store_count}</li>
                    </ul>
                </volist>
                </div>
            </div>
            <div class="pop-goods-paging">
                <span><i id="page2">1</i>/<i id="count2">{$count}</i></span>
                <a onclick="page_show2(1);" href="javascript:;">&gt;</a>
                <a onclick="page_show2(0);" href="javascript:;">&lt;</a>
            </div>
        </li>

    </ul>
    <div class="pop-link-btns">
        <a href="javascript:;" id="link-cancel2">取消</a>
        <a href="javascript:;" id="link-ok2">确定</a>
    </div>
    <script>
        function popLink() {
            var closeBtn=$('.pop-link>.close-pop-btn');
            closeBtn.click(function () {  //关闭弹窗
                $('#shade-module2').fadeOut();
                $('#pop-link2').slideUp();
            })
            $('#link-cancel2').click(function () {  //取消
//            do something...
                closeBtn.trigger('click');
            })
            $('#link-ok2').click(function () {  //弹窗选择链接确定
                var goods='';
                $("#p-goods-list input[checked='checked']").each(function(){ 
                    goods+=$(this).val()+',';
                })
                if(!goods){
                    layer.msg('你还没有选择商品!', {icon: 2, time: 1000});
                    return false;
                }
                //alert(tab_item);return;
                $.post("{:U('Admin/Block/goods_list_block')}",{'num':block[divid].num,'goods':goods,'order':block[divid].order},function(res){
                    $('.tpd-edits-hidden.tpd-editing').find('.tpdm-goods-list ul').html(res.result);
                    block[divid].nav[tab_item].sql_where={'num':block[divid].num,'goods':goods,'order':block[divid].order};
                    $('#p-goods-list').find('input').removeAttr('checked');   //可强制设为单选
                },'JSON');
                closeBtn.trigger('click');
            })
        }
        popLink();


        $("#p-goods-list").on('click','input',function(){
            if($(this).attr('checked')=='checked'){
                $(this).removeAttr('checked');
            }else{
                $(this).attr('checked','checked');
                //$(this).parents('.p-goods-item').siblings().find('input').removeAttr('checked');   //可强制设为单选
            }
        });


        $('#goods_search2').click(function(){
            var keywords=$('#goods_keywords2').val();
            ajax_goods_list2(keywords,1);
            $('#search_history2').val(keywords);
            $('#page2').html(1);
        })

        function page_show2(status){
            var page=parseInt($('#page2').html());
            if(status==0){
                page=page-1;
                if(page<1){
                    page=1;
                    return;
                }
            }
            if(status==1){
                page=page+1;
                if(page>parseInt($('#count2').html())){
                    page=parseInt($('#count2').html());
                    return;
                }
            }
            $('#page2').html(page);
            var keywords=$('#search_history2').val();
            ajax_goods_list(keywords,page);
        }

        function ajax_goods_list2(keywords,page) {
            $.ajax({
                type: "POST",
                url: "/index.php?m=Admin&c=block&a=ajaxGoodsList",
                data: {'keywords':keywords,'page':page},
                dataType:'json',
                success: function (res) {
                    var r=res.result;
                    if(r.html){
                        $('#p-goods-list').html(r.html);
                    }
                    if(r.count){
                        $('#count2').html(r.count);
                    }
                }
            });
        }

    </script>
</div>

<!--优惠券-->
<div class="pop-warp pop-coupon" id="pop-coupon" style="display:none">
    <div class="pop-title">优惠券列表<span style="color:red"> (首页仅可发放领取类型为免费领取且发放起始时间小于当前时间的优惠券)</span></div>
    <a class="close-pop-btn" href="javascript:;"></a>
    <!--div class="pop-operate">
        <a class="pop-add-btn" href="javascript:;">+ 新增优惠券</a>
        <div class="f-r">
            <a class="pop-reload" href="javascript:;">刷新</a>
            <form class="pop-search pop-coupon-search">
                <input type="text" placeholder="输入优惠券名称搜索" />
                <a href="javascript:;"></a>
            </form>
        </div>
    </div-->
    <ul class="pop-menu pop-coupon-menu">
        <li class="p-li00">优惠券名称</li>
        <li class="p-li01">面值</li>
        <li class="p-li02">使用条件</li>
        <li class="p-li02">领取条件</li>
        <!--li class="p-li04">有效期</li-->
        <li class="p-li05">是否选择</li>
    </ul>
    <div class="pop-coupon-warp">
        <div class="pop-coupon-list">

            <volist name="coupon_list" id="vo">
            <ul class="pop-coupon-item">
                <li class="pi-li00">{$vo.name}</li>
                <li class="pi-li01">{$vo.money}</li>
                <li class="pi-li02">满{$vo.condition}使用</li>
                <li class="pi-li02"> {$vo.use_type_title} </li>
                <!--li class="pi-li04">2017-12-04 00:00:00
                    至 2017-12-05 00:00:00</li-->
                <li class="pi-li05" coupon_id="{$vo.id}" money="{$vo.money}" term="{$vo.condition}">
                    <div class="pop-swith"></div>
                </li>
            </ul>
            </volist>

        </div>
        <div class="pop-page">
            <a href="javascript:;">首页</a>
            <a href="javascript:;">上一页</a>
            <a class="pop-page-now" href="javascript:;">1</a>
            <a href="javascript:;">下一页</a>
            <a href="javascript:;">尾页</a>
            <input type="text" value="1" />
            <a class="pop-page-bgnone" href="javascript:;">跳转</a>
        </div>
    </div>
    <div class="pop-link-btns">
        <a href="javascript:;" id="coupon-cancel">取消</a>
        <a href="javascript:;" id="coupon-ok">确定</a>
    </div>
    <script>
        function popCoupon() {
            var closeBtn=$('.pop-coupon>.close-pop-btn');
            closeBtn.click(function () {  //关闭弹窗
                coupon_num=0;
                $('.pop-swith').removeClass('pop-swith-on');
                coupon_tmp=[];
                $('#shade-module').fadeOut();
                $('#pop-coupon').slideUp();
            })
            $('#coupon-cancel').click(function () {  //取消
                coupon_num=0;
                $('.pop-swith').removeClass('pop-swith-on');
                coupon_tmp=[];
                closeBtn.trigger('click');
            })
            $('#coupon-ok').click(function () {  //确定
                var tmp=coupon_tmp.length;
                if(block[divid].coupon_style=='0' && tmp<3){
                    layer.msg('所选优惠券数量不足', {icon: 2, time: 1000});
                    return false;
                }
                if(block[divid].coupon_style=='1' && tmp<2){
                    layer.msg('所选优惠券数量不足', {icon: 2, time: 1000});
                    return false;
                }

                var str='';
                for (var i = 0; i<tmp; i++) {
                    str+='<li><div class="tpdm-coupon-wrap">';
                    str+='<span><i>￥</i>'+parseInt(coupon_tmp[i].money)+'</span>';
                    if(coupon_tmp[i].condition){
                        str+='<label>满'+parseInt(coupon_tmp[i].condition)+'使用</label>'; //非满减类型不显示
                    }
                    str+='<a href="javascript:;" data-coupon-id="'+coupon_tmp[i]['id']+'" onclick="getCoupon(this)">立即领取</a></div></li>';
                };

                if(block[divid].coupon_style=='0'){
                    $('.tpd-edits-hidden.tpd-editing').find('.tpdm-coupon-lis1').html(str);
                }
                if(block[divid].coupon_style=='1'){
                    $('.tpd-edits-hidden.tpd-editing').find('.tpdm-coupon-lis2').html(str);
                }
                block[divid].nav=coupon_tmp;
                closeBtn.trigger('click');
            })
        }
        popCoupon();
    </script>
</div>
<!--拼团-->
<div class="pop-warp pop-group" id="pop-group" style="display:none">
    <div class="pop-title">拼团商品</div>
    <a class="close-pop-btn" href="javascript:;"></a>
    <div class="pop-operate">
        <a class="pop-add-btn" href="javascript:;">+ 新增拼团</a>
        <div class="f-r">
            <a class="pop-reload" href="javascript:;">刷新</a>
            <form class="pop-search pop-coupon-search">
                <input type="text" placeholder="输入活动名称搜索" />
                <a href="javascript:;"></a>
            </form>
        </div>
    </div>
    <ul class="pop-menu pop-coupon-menu">
        <li class="p-li10">活动名称</li>
        <li class="p-li11">有效期</li>
        <li class="p-li12">是否选择</li>
    </ul>
    <div class="pop-coupon-warp">
        <div class="pop-coupon-list">
            <ul class="pop-coupon-item">
                <li class="pi-li10">TPshop百人团汽车</li>
                <li class="pi-li11">2017-12-04 00:00:00
                    至 2017-12-05 00:00:00</li>
                <li class="pi-li12">
                    <div class="pop-swith"></div>
                </li>
            </ul>
            <ul class="pop-coupon-item">
                <li class="pi-li10">TPshop百人团汽车</li>
                <li class="pi-li11">2017-12-04 00:00:00
                    至 2017-12-05 00:00:00</li>
                <li class="pi-li12">
                    <div class="pop-swith"></div>
                </li>
            </ul>
            <ul class="pop-coupon-item">
                <li class="pi-li10">TPshop百人团汽车</li>
                <li class="pi-li11">2017-12-04 00:00:00
                    至 2017-12-05 00:00:00</li>
                <li class="pi-li12">
                    <div class="pop-swith"></div>
                </li>
            </ul>
        </div>
        <div class="pop-page">
            <a href="javascript:;">首页</a>
            <a href="javascript:;">上一页</a>
            <a class="pop-page-now" href="javascript:;">1</a>
            <a href="javascript:;">下一页</a>
            <a href="javascript:;">尾页</a>
            <input type="text" value="1" />
            <a class="pop-page-bgnone" href="javascript:;">跳转</a>
        </div>

    </div>
    <div class="pop-link-btns">
        <a href="javascript:;" id="group-cancel">取消</a>
        <a href="javascript:;" id="group-ok">确定</a>
    </div>
    <script>
        function popGroup() {
            var closeBtn=$('.pop-group>.close-pop-btn');
            closeBtn.click(function () {  //关闭弹窗
                $('#shade-module').fadeOut();
                $('#pop-group').slideUp();
            })
            $('#group-cancel').click(function () {  //取消
//            do something...
                closeBtn.trigger('click');
            })
            $('#group-ok').click(function () {  //确定
                closeBtn.trigger('click');
            })
        }
        popGroup();
    </script>
</div>
<!--秒杀-->
<div class="pop-warp pop-seckill" id="pop-seckill" style="display:none">
    <div class="pop-title">秒杀商品</div>
    <a class="close-pop-btn" href="javascript:;"></a>
    <div class="pop-operate">
        <a class="pop-add-btn" href="javascript:;">+ 新增秒杀</a>
        <div class="f-r">
            <a class="pop-reload" href="javascript:;">刷新</a>
            <form class="pop-search pop-coupon-search">
                <input type="text" placeholder="输入活动名称搜索" />
                <a href="javascript:;"></a>
            </form>
        </div>
    </div>
    <ul class="pop-menu pop-coupon-menu">
        <li class="p-li20">活动名称</li>
        <li class="p-li21">秒杀价格</li>
        <li class="p-li22">秒杀数量</li>
        <li class="p-li04">有效期</li>
        <li class="p-li24">是否选择</li>
    </ul>
    <div class="pop-coupon-warp">
        <div class="pop-coupon-list">
            <ul class="pop-coupon-item">
                <li class="pi-li20">TPshop汽车秒杀</li>
                <li class="pi-li21">2000.00</li>
                <li class="pi-li22">100</li>
                <li class="pi-li04">2017-12-04 00:00:00
                    至 2017-12-05 00:00:00</li>
                <li class="pi-li24">
                    <div class="pop-swith"></div>
                </li>
            </ul>
            <ul class="pop-coupon-item">
                <li class="pi-li20">TPshop汽车秒杀</li>
                <li class="pi-li21">2000.00</li>
                <li class="pi-li22">100</li>
                <li class="pi-li04">2017-12-04 00:00:00
                    至 2017-12-05 00:00:00</li>
                <li class="pi-li24">
                    <div class="pop-swith"></div>
                </li>
            </ul>
            <ul class="pop-coupon-item">
                <li class="pi-li20">TPshop汽车秒杀</li>
                <li class="pi-li21">2000.00</li>
                <li class="pi-li22">100</li>
                <li class="pi-li04">2017-12-04 00:00:00
                    至 2017-12-05 00:00:00</li>
                <li class="pi-li24">
                    <div class="pop-swith"></div>
                </li>
            </ul>
        </div>
        <div class="pop-page">
            <a href="javascript:;">首页</a>
            <a href="javascript:;">上一页</a>
            <a class="pop-page-now" href="javascript:;">1</a>
            <a href="javascript:;">下一页</a>
            <a href="javascript:;">尾页</a>
            <input type="text" value="1" />
            <a class="pop-page-bgnone" href="javascript:;">跳转</a>
        </div>
    </div>
    <div class="pop-link-btns">
        <a href="javascript:;" id="seckill-cancel">取消</a>
        <a href="javascript:;" id="seckill-ok">确定</a>
    </div>
    <script>
        function popSeckill() {
            var closeBtn=$('.pop-seckill>.close-pop-btn');
            closeBtn.click(function () {  //关闭弹窗
                $('#shade-module').fadeOut();
                $('#pop-seckill').slideUp();
            })
            $('#seckill-cancel').click(function () {  //取消
//            do something...
                closeBtn.trigger('click');
            })
            $('#seckill-ok').click(function () {  //确定
//            do something...
                closeBtn.trigger('click');
            })
        }
        popSeckill();
    </script>
</div>
<!--按条件选取商品-->
<div class="pop-warp pop-goods" id="pop-goods" style="display:none">
    <div class="pop-title">按条件选取商品</div>
    <a class="close-pop-btn" href="javascript:;"></a>
    <div class="pop-goods-category">
        <div class="left-goods-category">
            <div class="pop-category-title ico-pop1">商品分类</div>
            <div class="pop-category-wrap scrollbar">
                <div class="pop-category-list">

                    <volist name="cat_tree" id="vo">
                    <div class="pop-category-item">
                        <div class="pop-category1 categorys-item"><input class="cat_choice" level='1' type="checkbox" />{$vo.mobile_name}<i></i></div>
                        <ul class="pop-category2">
                            <volist name="$vo[son]" id="vo2">
                            <li class="categorys-item"><input class="cat_choice" type="checkbox" value="{$vo2.id}" />{$vo2.mobile_name}</li>
                            </volist>
                        </ul>
                    </div>
                    </volist>

                </div>
                <script>
                    $('.pop-category-item').find('.pop-category1>i').click(function () {
                        $(this).toggleClass('category1-ac');
                        $(this).parents('.pop-category-item').find('.pop-category2').toggleClass('category2-ac');

                    });

                    $(".pop-category-list").on('click','.pop-category-item .cat_choice',function(){
                        if($(this).attr('checked')=='checked'){
                            $(this).removeAttr('checked');
                            if($(this).attr('level')==1){
                                $(this).parents('.pop-category1').next().find('input').removeAttr('checked');
                            }
                        }else{
                            $(this).attr('checked','checked');
                            if($(this).attr('level')==1){
                                $(this).parents('.pop-category1').next().find('input').attr('checked','checked').prop('checked','checked');
                            }

                            $(this).parents('.p-goods-item').siblings().find('input').removeAttr('checked');
                        }
                    });
                </script>
            </div>
        </div>
        <div class="right-goods-des">
            <div class="pop-category-title ico-pop2">价格</div>
            <div class="pop-category-price">
                <input id="min_price" type="text" placeholder="最低价格" />
                至
                <input id="max_price" type="text" placeholder="最高价格" />
                元
            </div>
            <div class="pop-category-title ico-pop3">商品标签</div>
            <ul class="pop-category-chcekbox">
                <li><input type="radio" name="goods_label" value=" " />不设置</li>
                <li><input type="radio" name="goods_label" value="is_recommend" />推荐</li>
                <li><input type="radio" name="goods_label" value="is_new" />新品</li>
                <li><input type="radio" name="goods_label" value="is_hot" />热卖</li>
            </ul>
        </div>
    </div>
    <div class="pop-link-btns">
        <a href="javascript:;" id="goods-cancel">取消</a>
        <a href="javascript:;" id="goods-ok">确定</a>
    </div>
    <script>
        var add_url="{:U('Admin/Block/add_data')}"; //保存添加的控制器地址

        $('.tpdm-head-wrap').on('click','a',function(e){
            e.preventDefault();
        })
        $('.tpdm-footf-js').on('click','a',function(e){
            e.preventDefault();
        })

        function popGoods() {
            var closeBtn=$('.pop-goods>.close-pop-btn');
            closeBtn.click(function () {  //关闭弹窗
                $('#shade-module').fadeOut();
                $('#pop-goods').slideUp();
            })
            $('#goods-cancel').click(function () {  //取消
//            do something...
                closeBtn.trigger('click');
            })
            $('#goods-ok').click(function () {  //确定             
               if($('#min_price').val()){
                    var min_price=parseInt($('#min_price').val());
               }else{
                    var min_price='';
               }
               
               if($('#max_price').val()){
                    var max_price=parseInt($('#max_price').val());
               }else{
                    var max_price='';
               }
               
               if(min_price && max_price && (min_price>=max_price)){
                    layer.msg('价格设置错误', {icon: 2, time: 1000});
                    return false;
               }

               var label=$("input[name='goods_label']:checked").val();

                var ids='';
                $(".pop-category2 input[checked='checked']").each(function(){ 
                    ids+=$(this).val()+',';
                }) 
                //此处id_type为1表示传递的ids是分类id
                $.post("{:U('Admin/Block/goods_list_block')}",{'min_price':min_price,'max_price':max_price,'num':block[divid].num,'label':label,'ids':ids,'order':block[divid].order},function(res){
                    $('.tpd-edits-hidden.tpd-editing').find('.tpdm-goods-list ul').html(res.result);
                    //block[divid].nav[tab_item].str=res.result;
                    block[divid].nav[tab_item].sql_where={'min_price':min_price,'max_price':max_price,'num':block[divid].num,'label':label,'ids':ids,'order':block[divid].order};
                    $('#min_price').val("");
                    $('#max_price').val("");
                },'JSON');

                closeBtn.trigger('click');
            })
        }
        popGoods();



    var ajax_return_status = 1;
    function save_data(){
        if(ajax_return_status == 0){
            return false;
        }

        var edit_id=$('#do_edit').val();
        var template_name=$('#block_name').val();
        if(!template_name){
            layer.msg('模板名称不能为空', {icon: 2, time: 1000});
            return false;
        }

        var view=$('#tpd-mobile-views');
        if(view.find('.tpd-edits-hidden[data-eidtid="1"]').length>0){
            view.find('.tpd-edits-hidden[data-eidtid="1"]').each(function () {
                var obj=$(this).find('.tpdm-carousel');
                obj.find('li').removeAttr('style');
                obj.find('li:first').remove();
                obj.find('li:last').remove();
                var li=obj.find('ul').html();
                var html='<ul class="tpd-banner-list">'+li+'</ul><div class="page-num"></div>';
                obj.html(html);
            })
        }
        var html=view.html();
        view.html(html);

        $("#tpd-mobile-views .tpd-edits-hidden").each(function(){
            var order=$(this).attr("data-timeid");
            block[order]['div_order']=$(this).index();//给板块增加排序索引 APP使用
        });

        var d=JSON.stringify(block);
        ajax_return_status = 0;
        $.post(add_url, {'html':html,'edit_id':edit_id,'info':d,'template_name':template_name}, function (res2) {
            if(res2){
                ajax_return_status=1;
                $('#do_edit').val(res2); 
                layer.msg('保存成功', {icon: 1, time: 1000});
            }else{
                layer.msg('保存失败,请稍后再提交', {icon: 2, time: 1000}); 
            }
        },'JSON');
    }
    </script>
</div>
</body>
</html>